|
|
@ -25,14 +25,14 @@ distribution.
|
|
|
|
#ifndef SIMPLEAPI_H_INCLUDED
|
|
|
|
#ifndef SIMPLEAPI_H_INCLUDED
|
|
|
|
#define SIMPLEAPI_H_INCLUDED
|
|
|
|
#define SIMPLEAPI_H_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
#include <Tranquility.h>
|
|
|
|
#include "Tranquility.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "Export.h"
|
|
|
|
#include "Export.h"
|
|
|
|
#include <string>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
#include <map>
|
|
|
|
#include "integers.h"
|
|
|
|
#include "integers.h"
|
|
|
|
#include "DFTileTypes.h"
|
|
|
|
#include "DFTileTypes.h"
|
|
|
|
|
|
|
|
#include "DFTypes.h"
|
|
|
|
#include "DFWindow.h"
|
|
|
|
#include "DFWindow.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace DFHack
|
|
|
|
namespace DFHack
|
|
|
@ -44,7 +44,7 @@ namespace DFHack
|
|
|
|
class Private;
|
|
|
|
class Private;
|
|
|
|
Private * const d;
|
|
|
|
Private * const d;
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
API(const string path_to_xml);
|
|
|
|
API(const std::string path_to_xml);
|
|
|
|
~API();
|
|
|
|
~API();
|
|
|
|
bool Attach();
|
|
|
|
bool Attach();
|
|
|
|
bool Detach();
|
|
|
|
bool Detach();
|
|
|
@ -76,12 +76,12 @@ namespace DFHack
|
|
|
|
* I'll keep it like this, even with the code duplication as it will hopefully get more features and separate data types later.
|
|
|
|
* I'll keep it like this, even with the code duplication as it will hopefully get more features and separate data types later.
|
|
|
|
* Yay for nebulous plans for a rock survey tool that tracks how much of which metal could be smelted from available resorces
|
|
|
|
* Yay for nebulous plans for a rock survey tool that tracks how much of which metal could be smelted from available resorces
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool ReadStoneMatgloss(vector<t_matgloss> & output);
|
|
|
|
bool ReadStoneMatgloss(std::vector<t_matgloss> & output);
|
|
|
|
bool ReadWoodMatgloss (vector<t_matgloss> & output);
|
|
|
|
bool ReadWoodMatgloss (std::vector<t_matgloss> & output);
|
|
|
|
bool ReadMetalMatgloss(vector<t_matgloss> & output);
|
|
|
|
bool ReadMetalMatgloss(std::vector<t_matgloss> & output);
|
|
|
|
bool ReadPlantMatgloss(vector<t_matgloss> & output);
|
|
|
|
bool ReadPlantMatgloss(std::vector<t_matgloss> & output);
|
|
|
|
bool ReadPlantMatgloss (vector<t_matglossPlant> & plants);
|
|
|
|
bool ReadPlantMatgloss (std::vector<t_matglossPlant> & plants);
|
|
|
|
bool ReadCreatureMatgloss(vector<t_matgloss> & output);
|
|
|
|
bool ReadCreatureMatgloss(std::vector<t_matgloss> & output);
|
|
|
|
|
|
|
|
|
|
|
|
// read region surroundings, get their vectors of geolayers so we can do translation (or just hand the translation table to the client)
|
|
|
|
// read region surroundings, get their vectors of geolayers so we can do translation (or just hand the translation table to the client)
|
|
|
|
// returns an array of 9 vectors of indices into stone matgloss
|
|
|
|
// returns an array of 9 vectors of indices into stone matgloss
|
|
|
@ -114,7 +114,7 @@ namespace DFHack
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool ReadGeology( vector < vector <uint16_t> >& assign );
|
|
|
|
bool ReadGeology( std::vector < std::vector <uint16_t> >& assign );
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* BLOCK DATA
|
|
|
|
* BLOCK DATA
|
|
|
@ -151,7 +151,7 @@ namespace DFHack
|
|
|
|
bool ReadRegionOffsets(uint32_t blockx, uint32_t blocky, uint32_t blockz, uint8_t *buffer); // 16 * sizeof(uint8_t)
|
|
|
|
bool ReadRegionOffsets(uint32_t blockx, uint32_t blocky, uint32_t blockz, uint8_t *buffer); // 16 * sizeof(uint8_t)
|
|
|
|
|
|
|
|
|
|
|
|
/// read aggregated veins of a block
|
|
|
|
/// read aggregated veins of a block
|
|
|
|
bool ReadVeins(uint32_t blockx, uint32_t blocky, uint32_t blockz, vector <t_vein> & veins, vector <t_frozenliquidvein>& ices);
|
|
|
|
bool ReadVeins(uint32_t blockx, uint32_t blocky, uint32_t blockz, std::vector <t_vein> & veins, std::vector <t_frozenliquidvein>& ices);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Buildings, constructions, plants, all pretty straighforward. InitReadBuildings returns all the building types as a mapping between a numeric values and strings
|
|
|
|
* Buildings, constructions, plants, all pretty straighforward. InitReadBuildings returns all the building types as a mapping between a numeric values and strings
|
|
|
@ -200,13 +200,15 @@ namespace DFHack
|
|
|
|
bool setCursorCoords (const int32_t &x, const int32_t &y, const int32_t &z);
|
|
|
|
bool setCursorCoords (const int32_t &x, const int32_t &y, const int32_t &z);
|
|
|
|
|
|
|
|
|
|
|
|
/// This returns false if there is nothing under the cursor, it puts the addresses in a vector if there is
|
|
|
|
/// This returns false if there is nothing under the cursor, it puts the addresses in a vector if there is
|
|
|
|
bool getCurrentCursorCreatures(vector<uint32_t> &addresses);
|
|
|
|
bool getCurrentCursorCreatures(std::vector<uint32_t> &addresses);
|
|
|
|
|
|
|
|
|
|
|
|
bool InitViewSize();
|
|
|
|
bool InitViewSize();
|
|
|
|
bool getWindowSize(int32_t & width, int32_t & height);
|
|
|
|
bool getWindowSize(int32_t & width, int32_t & height);
|
|
|
|
|
|
|
|
/* unimplemented
|
|
|
|
bool setWindowSize(const int32_t & width, const int32_t & height);
|
|
|
|
bool setWindowSize(const int32_t & width, const int32_t & height);
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
void getItemIndexesInBox(vector<uint32_t> &indexes,
|
|
|
|
void getItemIndexesInBox(std::vector<uint32_t> &indexes,
|
|
|
|
const uint16_t &x1, const uint16_t &y1, const uint16_t &z1,
|
|
|
|
const uint16_t &x1, const uint16_t &y1, const uint16_t &z1,
|
|
|
|
const uint16_t &x2, const uint16_t &y2, const uint16_t &z2);
|
|
|
|
const uint16_t &x2, const uint16_t &y2, const uint16_t &z2);
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -219,12 +221,12 @@ namespace DFHack
|
|
|
|
vector<t_trait> getTraits(const uint32_t &index);
|
|
|
|
vector<t_trait> getTraits(const uint32_t &index);
|
|
|
|
vector<t_labor> getLabors(const uint32_t &index);
|
|
|
|
vector<t_labor> getLabors(const uint32_t &index);
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool InitReadNameTables (map< string, vector<string> > & nameTable);
|
|
|
|
bool InitReadNameTables (std::map< std::string, std::vector<std::string> > & nameTable);
|
|
|
|
void FinishReadNameTables();
|
|
|
|
void FinishReadNameTables();
|
|
|
|
|
|
|
|
|
|
|
|
string TranslateName(const t_lastname & last, const map< string, vector< string > > &nameTable,const string & language="GENERIC");
|
|
|
|
std::string TranslateName(const t_lastname & last, const std::map< std::string, std::vector< std::string > > &nameTable,const std::string & language="GENERIC");
|
|
|
|
string TranslateName(const t_squadname & squad, const map< string, vector< string > > &nameTable,const string & language="GENERIC");
|
|
|
|
std::string TranslateName(const t_squadname & squad, const std::map< std::string, std::vector< std::string > > &nameTable,const std::string & language="GENERIC");
|
|
|
|
string TranslateName (const int names[], int size, const map<string, vector<string> > & nameTable, const string & language="GENERIC");
|
|
|
|
std::string TranslateName (const int names[], int size, const std::map<std::string, std::vector<std::string> > &nameTable, const std::string & language="GENERIC");
|
|
|
|
|
|
|
|
|
|
|
|
void WriteLabors(const uint32_t &index, uint8_t labors[NUM_CREATURE_LABORS]);
|
|
|
|
void WriteLabors(const uint32_t &index, uint8_t labors[NUM_CREATURE_LABORS]);
|
|
|
|
|
|
|
|
|
|
|
@ -239,7 +241,7 @@ namespace DFHack
|
|
|
|
// FIXME: BAD!
|
|
|
|
// FIXME: BAD!
|
|
|
|
bool ReadAllMatgloss(vector< vector< string > > & all);
|
|
|
|
bool ReadAllMatgloss(vector< vector< string > > & all);
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool ReadItemTypes(vector< vector< t_itemType > > & itemTypes);
|
|
|
|
bool ReadItemTypes(std::vector< std::vector< t_itemType > > & itemTypes);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} // namespace DFHack
|
|
|
|
} // namespace DFHack
|
|
|
|
#endif // SIMPLEAPI_H_INCLUDED
|
|
|
|
#endif // SIMPLEAPI_H_INCLUDED
|
|
|
|