Esempio n. 1
0
        private void TurnRight(Ant ant)
        {
            switch (ant.Direction)
            {
            case Direction.E:
                ant.Direction = Direction.S;
                break;

            case Direction.W:
                ant.Direction = Direction.N;
                break;

            case Direction.N:
                ant.Direction = Direction.E;
                break;

            case Direction.S:
                ant.Direction = Direction.E;
                break;
            }
        }
 public AntMoveForwardCommand(Ant ant)
 {
     this._ant = ant;
 }
Esempio n. 3
0
 public AntLeftRotateCommand(Ant ant)
 {
     this._ant = ant;
 }
Esempio n. 4
0
 public AntRightRotateCommand(Ant ant)
 {
     this._ant = ant;
 }