Beispiel #1
0
 public void hitted(AgentV2 aAgent)
 {
     if (aAgent.getHP() == AgentV2.DEAD_LOW_LIMIT)
     {
         aAgent.changeState(AgentV2.Dead_STATE);
     }
 }
Beispiel #2
0
        public void test_received_fight_once()
        {
            var nsub    = Substitute.For <IAgentState>();
            var agentV2 = new AgentV2(nsub);

            agentV2.fight();
            nsub.Received(1).fight(agentV2);
        }
Beispiel #3
0
        public void test_received_search_once()
        {
            var nsub    = Substitute.For <IAgentState>();
            var agentV2 = new AgentV2(nsub);

            agentV2.search();
            nsub.Received(1).search(agentV2);
        }
Beispiel #4
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);
     }
 }
Beispiel #5
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);
     }
 }
Beispiel #6
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);
     }
 }
Beispiel #7
0
 public void fight(AgentV2 agentV2)
 {
     // Do something, I am already dead.
 }
Beispiel #8
0
 public void search(AgentV2 aAgent)
 {
     // Do something, I am already dead.
 }
Beispiel #9
0
 public void hitted(AgentV2 aAgent)
 {
     // Do something, I am already dead.
 }
Beispiel #10
0
 public void search(AgentV2 agentV2)
 {
     // Do something
 }
Beispiel #11
0
 public void fight(AgentV2 agentV2)
 {
     // Do something
 }
Beispiel #12
0
 public void search(AgentV2 aAgent)
 {
     // DO something
 }
Beispiel #13
0
 public void heal(AgentV2 aAgent)
 {
     // Similar to hit
 }