Hi.
What I like doing is a bit more work but I create a class that I define all the Objects Types in like, PLANT_TYPE has all things to do with plants.
class ObjTypePlant
{
static std::vector<UINT> PlantType;
static std::vector<std::string> TypeName;
public:
static DefinePlantType(UINT baseindx)//the startting range you want for plants to start at
{
//here you define your plants
PlantType.push_back(baseindex);//first plant type
TypeName.push_back("Tree1");
//when you want to define a new plant type add it to the list
baseindex++;//next type
PlantType.push_back(baseindex);
TypePlant.push_back("TheBushThatGiveLife");
baseindex++;//next type
}//end
//then setters and getters
static UINT GetType(UINT type)
{ UINT rt = -1;//sets it to max value a uint can hold
//find type in list or return -1
}
static UINT GetType(std::string type)
{
//same but find the string name or return -1 for error
}
};
use like
#define PLANT_START_RANGE 3000
#define UNIT_START_RANGE 4000//
//called at init time
ObjectTypePlant::DefinePlantType(PLANT_START_RANGE);
there static so you can have them through out the code base