dfhack/library/include/modules/Materials.h

165 lines
4.0 KiB
C

2010-04-04 16:48:19 -06:00
#ifndef CL_MOD_MATERIALS
#define CL_MOD_MATERIALS
/*
* Creatures
*/
2010-05-25 22:48:23 -06:00
#include "dfhack/DFExport.h"
2010-04-04 16:48:19 -06:00
namespace DFHack
{
2010-05-23 15:06:10 -06:00
class DFContextPrivate;
2010-04-04 16:48:19 -06:00
struct t_matgloss
{
char id[128]; //the id in the raws
uint8_t fore; // Annoyingly the offset for this differs between types
uint8_t back;
uint8_t bright;
char name[128]; //this is the name displayed ingame
};
2010-04-20 10:25:52 -06:00
struct t_descriptor_color
{
2010-04-28 15:48:50 -06:00
char id[128]; // id in the raws
float r;
float v;
float b;
char name[128]; //displayed name
2010-04-20 10:25:52 -06:00
};
2010-04-04 16:48:19 -06:00
struct t_matglossPlant
{
char id[128]; //the id in the raws
uint8_t fore; // Annoyingly the offset for this differs between types
uint8_t back;
uint8_t bright;
char name[128]; //this is the name displayed ingame
char drink_name[128]; //the name this item becomes a drink
char food_name[128];
char extract_name[128];
};
struct t_bodypart
{
char id[128];
char category[128];
char single[128];
char plural[128];
};
struct t_colormodifier
{
char part[128];
std::vector<uint32_t> colorlist;
uint32_t startdate; /* in days */
uint32_t enddate; /* in days */
};
2010-04-04 16:48:19 -06:00
2010-04-14 14:12:02 -06:00
struct t_creaturecaste
{
char rawname[128];
char singular[128];
char plural[128];
char adjective[128];
std::vector<t_colormodifier> ColorModifier;
std::vector<t_bodypart> bodypart;
t_attrib strength;
t_attrib agility;
t_attrib toughness;
t_attrib endurance;
t_attrib recuperation;
t_attrib disease_resistance;
t_attrib analytical_ability;
t_attrib focus;
t_attrib willpower;
t_attrib creativity;
t_attrib intuition;
t_attrib patience;
t_attrib memory;
t_attrib linguistic_ability;
t_attrib spatial_sense;
t_attrib musicality;
t_attrib kinesthetic_sense;
2010-04-14 14:12:02 -06:00
};
2010-04-30 09:03:21 -06:00
struct t_matglossOther
{
char rawname[128];
};
2010-04-30 09:03:21 -06:00
struct t_creatureextract
{
char rawname[128];
};
2010-04-15 05:04:58 -06:00
// this doesn't transfer well across the shm gap...
2010-04-14 14:12:02 -06:00
struct t_creaturetype
{
char rawname[128];
std::vector <t_creaturecaste> castes;
2010-04-30 09:03:21 -06:00
std::vector <t_creatureextract> extract;
uint8_t tile_character;
struct
{
uint16_t fore;
uint16_t back;
uint16_t bright;
} tilecolor;
2010-04-14 14:12:02 -06:00
};
// this structure describes what are things made of in the DF world
struct t_material
{
int16_t itemType;
int16_t subType;
int16_t subIndex;
int32_t index;
uint32_t flags;
};
2010-04-14 14:12:02 -06:00
2010-04-04 16:48:19 -06:00
class DFHACK_EXPORT Materials
{
public:
2010-05-23 15:06:10 -06:00
Materials(DFHack::DFContextPrivate * _d);
~Materials();
2010-04-28 10:09:32 -06:00
std::vector<t_matgloss> inorganic;
std::vector<t_matgloss> organic;
std::vector<t_matgloss> tree;
std::vector<t_matgloss> plant;
std::vector<t_matgloss> race;
std::vector<t_creaturetype> raceEx;
std::vector<t_descriptor_color> color;
std::vector<t_matglossOther> other;
2010-05-05 04:57:05 -06:00
std::vector<t_matgloss> alldesc;
2010-04-28 10:09:32 -06:00
bool ReadInorganicMaterials (void);
bool ReadOrganicMaterials (void);
bool ReadWoodMaterials (void);
bool ReadPlantMaterials (void);
bool ReadCreatureTypes (void);
bool ReadCreatureTypesEx (void);
bool ReadDescriptorColors(void);
bool ReadOthers (void);
void ReadAllMaterials(void);
std::string getDescription(t_material & mat);
/*
bool ReadInorganicMaterials (std::vector<t_matgloss> & output);
bool ReadOrganicMaterials (std::vector<t_matgloss> & output);
bool ReadWoodMaterials (std::vector<t_matgloss> & output);
bool ReadPlantMaterials (std::vector<t_matgloss> & output);
// TODO: maybe move to creatures?
bool ReadCreatureTypes (std::vector<t_matgloss> & output);
bool ReadCreatureTypesEx (vector<t_creaturetype> & creatures);
bool ReadDescriptorColors(std::vector<t_descriptor_color> & output);
*/
private:
class Private;
Private* d;
};
2010-04-04 16:48:19 -06:00
}
#endif