Exemplo n.º 1
0
        private void InvokeOnMove(MoveInfo info, ITactics tactics)
        {
            MoveMade move = OnMove;

            if (move != null)
            {
                move(info, tactics);
            }
        }
Exemplo n.º 2
0
 //TODO: remove dirty hack
 public override void Start(State state, ITactics ts)
 {
     index = tactics.FindIndex(x => x.ShouldBeStarted(state));
     if (index == -1)
     {
         index = 0;
     }
     tactics[index].Start(state, ts);
 }
Exemplo n.º 3
0
        private void AddToHistory(MoveInfo info, ITactics source)
        {
            if (source is RollbackTactics)
            {
                return;
            }

            if (history.Count > 0 && history.Peek().Destination == info.Destination)
            {
                return;
            }

            if (source is DefaultTactics || source is DeadlyTactics)
            {
                history.Clear();
            }

            history.Push(info);
        }
Exemplo n.º 4
0
 public override void Start(State state, ITactics prev)
 {
     prev.Priority += 0.05;
 }
Exemplo n.º 5
0
 public void AddInnerTactics(ITactics t)
 {
     tactics.Add(t);
 }
Exemplo n.º 6
0
 public override void Start(State state, ITactics tactics)
 {
     timesLeft = initialTimes;
 }
Exemplo n.º 7
0
 public virtual void Start(State state, ITactics prev)
 {
 }
Exemplo n.º 8
0
 public override void Start(State state, ITactics tactics)
 {
     index = 1 + WayPoints.FindIndex(x => x.Coordinates == state.Fighter.Coordinates);
 }