Hi
I have a general class handling inventories in my game engine (c++)
It has a function getItemNames:
char * gameInventoryMaster::getItemName(gameItem * uu)
{
if(useSpecialNames)
return getSpecialItemName(uu);
else
return IDATA[uu->type].name;
}
The getSpecialItemName is just declared in the general engine class, not defined.
Instead it is defined in each game separately (because some games may have diablo-like item modifiers that affect name, while others affect item names in another manner etc).
Problem is its unpractical to be forced to define that function in all games using the engine (some games dont use inventories or at least not specialItemNames).
If i dont add a definition i get compiler errors (fatal error LNK1120: 1 unresolved externals). I want to leave it "empty" (not there) if i dont use it. Is it not possible in c++?
Thanks
Erik