So let's say I have a class called CSprite which loads a sprite sheet. Within that class will be at least one CAnimation object which takes user-defined snippets from the sprite sheet and loops them.. so for example I might want:
CAnimation m_AnimNormal, m_AnimOnFire;
inside the actual CSprite object.
The problem is that I might have 20 or 30 such loops per sprite sheet. So I will need a vector (std::vector<CAnimation> anims) or something, but I don't want the programmer to just refer to them as "anims". I would like meaningful names, so that later I can just say something like:
m_Sprite.DisplaySurface(m_AnimNormal);
instead of
m_Sprite.DisplaySurface(anims);
But how do I go about creating useable names dynamically? The only thing I can think of is anims.push_back(whatever), which isn't very descriptive.
Of-course I could delve into strings and associate some string in a separate vector with each animation object and then set up a for loop to check the strings each time... but for some reason this seems like the wrong way to go about it...
Cheers