instead of the engine beeing fixated on energy & metal, we would have a dynamic set of resources.
This concept is already visible in the C AI interface, and in:
Code: Select all
rts/Misc/Resource(.h|.cpp)
rts/Misc/ResourceHandler(.h|.cpp)
for taking it further, the rest of the engine, and (later) the Lua interface would adopt the principles the C AI interface uses already. To clarify, a fe examples:
now:
Code: Select all
struct UnitDef
{
float metalUpkeep;
float energyUpkeep;
float metalMake;
float makesMetal;
float energyMake;
};
class CUnit
{
bool UseMetal(float metal);
void AddMetal(float metal, bool handicap = true);
bool UseEnergy(float energy);
void AddEnergy(float energy, bool handicap = true);
};
Code: Select all
struct UnitDef
{
std::vector<float> resourceUpkeep;
std::vector<float> makesResource;
std::vector<float> resourceMake;
};
class CUnit
{
bool UseResource(int resourceId, float metal);
void AddResource(int resourceId, float metal, bool handicap = true);
};