I'm a game programmer and currently working on a generic system that works for most type of games. I have a generic piece of code, that I use on anything that could increase/decrease called
EffectCauser - It has a bunch of parameters for it to work:
- The target component (health, mana, speed, stamina, etc)
- The effect methodology (
- The effect type (
- The effect amount.
First let me explain how this works in a couple of simple examples so that you understand better:
Let's say I wanted to create a first aid kit. I create an
EffectCauser which will cause its effect on the
Health component of the target object, I specify the methodology of the effect of type
OneHit and the type of the effect to be
Positive and an amount I choose, lets say 100 for a full heal.
Another example, if I wanted to create a Mana spell that decreases mana overtime:
I would create an effect causer that targets the
Mana component of a target, select a methodology of
Overtime (temporarily in other words) (filling the appropriate time values), an effect type of
Negative this time, and an amount, like 50. (Imagine a spell in an RPG game where an enemy cast it at you, so you get -50 mana over a 10 sec time period)
And so on and so forth. I could do this for a
The main thing for this to work is that all these things (Health, Mana, Speed, Stamina, etc) have to implement a common interface. I'm not being able to find the name of that interface.
One common thing between all these things, is that they increase and decrease. I thought of
IChangable but that's very generic, maybe
IIncreasableDecreasable but that's very long, and screaming "there's a better word than me"
Note that the convention of naming interfaces, is "IXXXable" (IMovable, ICombinable, ITransformable, etc)
So, what can I use here? what is the word that satisfies my needs?
Thanks a lot.
EDIT: To make it easy, it need not be an interface. I could create an abstract class. Interfaces define behavior, while a class is for something that exists. I just have to change my way of thinking.
Ex: an abstract
Enemy as children.
Enemy are a
Character is an abstract term for
So... what are
Speed, etc? For one thing, they're
Components but what else? (I can't use
Component here due to ambiguity as well). What about
PlayerAttribute? well, for one thing I can attach
Health to an enemy, not just the player. So...
CharacterAttribute is good? nop, still ambiguous. (Attribute means a total separate thing in .NET)... I'm out of words :(
If you ever played an RPG game, what would a common name be to all your player stuff? (health, mana, agility, stamina, speed, dexterity, etc)