Exemple #1
0
        public Player(Coordonates position)
        {
            this.Position = position;

            moveStrategies = new Dictionary <Cardinal, IMoveStrategy>();
            moveStrategies.Add(Cardinal.N, new UpMoveStrategy());
            moveStrategies.Add(Cardinal.S, new DownMoveStrategy());
            moveStrategies.Add(Cardinal.V, new LeftMoveStrategy());
            moveStrategies.Add(Cardinal.E, new RightMoveStrategy());
        }
Exemple #2
0
 public void ExecuteMove(Coordonates coordonates)
 {
     coordonates.X++;
     Console.WriteLine("R");
 }
Exemple #3
0
 public void ExecuteMove(Coordonates coordonates)
 {
     coordonates.Y--;
     Console.WriteLine("D");
 }
Exemple #4
0
 public void UpdatePosition(Coordonates position)
 {
     Position = position;
 }