Пример #1
0
        public void test_default_state_when_game_start()
        {
            Assert.IsNotNull(agent.getState());

            Assert.AreEqual(health.GetType(), agent.getState().GetType(), "Test default state is Health");
            Assert.AreEqual(MAX_HP, agent.getHP(), "Test default HP is MAX_HP");
        }
Пример #2
0
 public void heal(AgentV2 aAgent)
 {
     if (aAgent.getHP() >= AgentV2.HEALTH_LOW_LIMIT)
     {
         aAgent.changeState(AgentV2.Health_STATE);
     }
     else if (aAgent.getHP() >= AgentV2.INJURED_LOW_LIMIT)
     {
         aAgent.changeState(AgentV2.Injured_STATE);
     }
 }
Пример #3
0
 public void hitted(AgentV2 aAgent)
 {
     if (aAgent.getHP() == AgentV2.DEAD_LOW_LIMIT)
     {
         aAgent.changeState(AgentV2.Dead_STATE);
     }
 }
Пример #4
0
 public void hitted(AgentV2 aAgent)
 {
     if (aAgent.getHP() < AgentV2.DYING_LOW_LIMIT)
     {
         //aAgent.changeState(new Dead());
         aAgent.changeState(AgentV2.Dead_STATE);
     }
     else if (aAgent.getHP() < AgentV2.INJURED_LOW_LIMIT)
     {
         aAgent.changeState(AgentV2.Dying_STATE);
     }
     else if (aAgent.getHP() < AgentV2.HEALTH_LOW_LIMIT)
     {
         //aAgent.changeState(new Injured());
         aAgent.changeState(AgentV2.Injured_STATE);
     }
 }
Пример #5
0
 public void heal(AgentV2 aAgent)
 {
     // resurrection
     if (aAgent.getHP() >= AgentV2.HEALTH_LOW_LIMIT)
     {
         //aAgent.changeState(new Health());
         aAgent.changeState(AgentV2.Health_STATE);
     }
     else if (aAgent.getHP() >= AgentV2.INJURED_LOW_LIMIT)
     {
         //aAgent.changeState(new Injured());
         aAgent.changeState(AgentV2.Injured_STATE);
     }
     else if (aAgent.getHP() >= AgentV2.DYING_LOW_LIMIT)
     {
         aAgent.changeState(AgentV2.Dying_STATE);
     }
 }