public int GetMaximumAttribute(Character.Attribute attribute) { switch (attribute) { case Character.Attribute.Level: return(this.maximumLevel); case Character.Attribute.Experience: return(CalculateMaximumValue(this.experience)); case Character.Attribute.HealthPoints: return(CalculateMaximumValue(this.healthPoints)); case Character.Attribute.ManaPoints: return(CalculateMaximumValue(this.manaPoints)); case Character.Attribute.Attack: return(CalculateMaximumValue(this.attack)); case Character.Attribute.Defense: return(CalculateMaximumValue(this.defense)); case Character.Attribute.SpecialAttack: return(CalculateMaximumValue(this.specialAttack)); case Character.Attribute.SpecialDefense: return(CalculateMaximumValue(this.specialDefense)); case Character.Attribute.Speed: return(CalculateMaximumValue(this.speed)); default: return(0); } }
/* * Getters y setters of current and maximum attributes */ public int GetCurrentAttribute(Character.Attribute attribute) { switch (attribute) { case Character.Attribute.Level: return(level); case Character.Attribute.Experience: return(currentExperience); case Character.Attribute.HealthPoints: return(currentHealthPoints); case Character.Attribute.ManaPoints: return(currentManaPoints); case Character.Attribute.Attack: return(currentAttack); case Character.Attribute.Defense: return(currentDefense); case Character.Attribute.SpecialAttack: return(currentSpecialAttack); case Character.Attribute.SpecialDefense: return(currentSpecialDefense); case Character.Attribute.Speed: return(currentSpeed); default: return(0); } }
public void DecreaseAttribute(Character.Attribute attribute, int decrement) { int currentValue = GetCurrentAttribute(attribute); if (currentValue > 0) { if ((currentValue - decrement) < 0) { SetCurrentAttribute(attribute, 0); } else { SetCurrentAttribute(attribute, (currentValue - decrement)); } } }
public void IncreaseAttribute(Character.Attribute attribute, int increment) { int currentValue = GetCurrentAttribute(attribute); int maximumValue = GetMaximumAttribute(attribute); if (currentValue < maximumValue) { if ((currentValue + increment) > maximumValue) { SetCurrentAttribute(attribute, maximumValue); } else { SetCurrentAttribute(attribute, (currentValue + increment)); } } }
public bool SetCurrentAttribute(Character.Attribute attribute, int value) { switch (attribute) { case Character.Attribute.Experience: currentExperience = value; break; case Character.Attribute.HealthPoints: currentHealthPoints = value; break; case Character.Attribute.ManaPoints: currentManaPoints = value; break; case Character.Attribute.Attack: currentAttack = value; break; case Character.Attribute.Defense: currentDefense = value; break; case Character.Attribute.SpecialAttack: currentSpecialAttack = value; break; case Character.Attribute.SpecialDefense: currentSpecialDefense = value; break; case Character.Attribute.Speed: currentSpeed = value; break; default: return(false); } return(true); }