Game: General Structure and Game Item Structure
===

I am making a graphically simple 3D game in C++ using DirectX. The main problem I am having is with how to structure some things efficiently. Right now I know my goal for certain areas but not how to ideally perform them.

For instance, right now I am storing all meshes and textures in an Asset class with enumerated definitions pointing to each asset. All meshes and textures are loaded when the game starts by creating an Asset object and initializing it. From there I load meshes and textures to objects by assigning the pointer given by the Asset object. Is this the best way to go about this?

A harder topic is that of items. For the sake of argument I am going to say we are dealing with scenery. Right now my scenery needs the following:

 - A name
 - A mesh
 - Textures (optional)
 - Flags (such as Destructible, Flammable, etc.)
 - Status (such as Burning, Locked, Cursed, etc.)
 - Abilities (things the object actually does, such as becoming damaged when burning)

The first 5 things on this list are simply variables. But abilities are bothering me. The first 5 can all exist in one item class. But what I do not know how to do is somehow attach abilities to the object.

For example; I want the object to have the "Fire Nova" ability. At the start of each turn, the object damages anything near it. 

For me, this means each object would need a "Trigger_Phase_TurnStart()" or some similarly named method and would then need a new "Fire Nova" class with its own unique action for that trigger and its own extra variables (Damage, Range, etc). So now I have the base object class and a new Fire Nova class that inherits from it.

But now what if I needed an object that has Fire Nova and Frost Nova and also Slowing Aura and other such abilities. Basically I need a way to add triggered effects to an object without needing a new object class for each of them.

So by the end I would be able to have say:

    (pseudo code of the object's components)
    name = Elemental Orb
    mesh = "Mesh_Sphere"
    textures[] = "Tex_Ice", "Tex_Fire"
    flags = OF_Destructible
    status = SF_Cursed | SF_Burning
    abilities[] = Fire_Nova, Frost_Nova, Slowing_Aura

And this orb would simply be the object class with all these attributes. The object would then activate each stored ability's trigger at the appropriate turn phase for any actions to perform.

Right now I am thinking I might need to make a class for each ability possessing every turn-phase or action trigger (inherited from a base ability class) and have them perform the appropriate action when the object calls them from it's array of abilities. Would this be the best way to do this?


As a separate issue. Some flags would require additional variables that would otherwise be unnecessary. For example, Destructible would mean the object would have health whereas without the flag it wouldn't need it, or an Openable item would need an array of contents. What would be a good way to ration these variables to when they are needed? I do not need every wall to have health and an empty contents array for example.


Finally. Assuming the bullet-listed attributes above are all an item needs, how would people suggest I best store them? To clarify, I would like to be able to write:

    CreateItem(ITEM_TABLE);

and have this return the created object with name, mesh, textures, flags, status and abilities. What structure might be suitable for create such an end effect?


To summarise:

1. Does my current Asset storage seem feasible?
2. What is the best way to create abilities to attach to the object class without making numerous separate object classes?
3. Is there a way to limit the variables (or at least memory usage) when the associated flag is not present?
4. What structure or format would be best for storing fixed item definitions?

Sorry if this is a little long winded. If you cannot answer all the questions then an answer to one would still be appreciated. Question two is probably the largest priority for me right now.

Thanks for your time :)