コード例 #1
0
        public void ChangeBreakHealth(HealthActionEnum action)
        {
            int newHealth = GetNewHealth(action, WaterHealth);

            if (ValidateHealth(newHealth))
            {
                WaterHealth = newHealth;
            }
        }
コード例 #2
0
        public void ChangeShortBreakHealth(HealthActionEnum action)
        {
            int newHealth = GetNewHealth(action, ShortBreakHealth);

            if (ValidateHealth(newHealth))
            {
                ShortBreakHealth = newHealth;
            }
        }
コード例 #3
0
 private int GetNewHealth(HealthActionEnum action, int health)
 {
     if (action.Equals(HealthActionEnum.INCREASE))
     {
         return(health + 1);
     }
     else
     {
         return(health - 1);
     }
 }