public void ChangeBreakHealth(HealthActionEnum action) { int newHealth = GetNewHealth(action, WaterHealth); if (ValidateHealth(newHealth)) { WaterHealth = newHealth; } }
public void ChangeShortBreakHealth(HealthActionEnum action) { int newHealth = GetNewHealth(action, ShortBreakHealth); if (ValidateHealth(newHealth)) { ShortBreakHealth = newHealth; } }
private int GetNewHealth(HealthActionEnum action, int health) { if (action.Equals(HealthActionEnum.INCREASE)) { return(health + 1); } else { return(health - 1); } }