Hi, A unit will have Defense rating per each of the 8 elements ( example shorten to 4 for simplicity).
And an attack will be one of the element.
public class DefenceAtt{
public int PHY;
public int ENERGY;
public int HEAT;
public int FROST;
public DefenceAtt()
{
PHY = 0;
ENERGY = 0;
HEAT = 0;
FROST = 0;
}
}
public enum ELEMENT{ PHY, ENERGY, HEAT, FROST, LAST };
public class Attack{
public int power;
public ELEMENT element;
public DealDamage(pow, element) { /*DO Something here*/ }
}
Beside using SWITCH statement, is there any other convenient way to compare the Attacking Element to the related defence attribute?
THX in advance,