public FleeState(AntsGame game, Ant agent) : base(game, agent) { }
/// <summary> /// Attacks enemy ant by decreasing the target's health by the attacker's attack rate /// </summary> /// <param name="target"></param> /// <returns>true if target ant is killed, false otherwise</returns> public bool Attack(Ant target) { // Check if ant is already dead if (target.IsDead) return false; target.Health -= AttackRate; if (target.IsDead) { AttackRate++; Console.WriteLine("{0} killed {1} (new attack rate: {2})", this, target, AttackRate); return true; } return false; }
public FollowState(AntsGame game, Ant agent, Ant target) : base(game, agent) { this.target = target; }
public AttackState(AntsGame game, Ant agent) : base(game, agent) { }
public State(AntsGame game, Ant agent) { Agent = agent; Game = game; }