Ejemplo n.º 1
0
 public GameState(GameState g)
 {
     this.Map = (int[,])g.Map.Clone();
     this.Player = (Point)g.Player.Clone();
     this.Opponent = (Point)g.Opponent.Clone();
     this.previousPlayerMove = g.previousPlayerMove;
 }
Ejemplo n.º 2
0
 public GameState(int[,] map, Point player, Point opponent, Move previousplayerMove)
 {
     this.Map = (int[,])map.Clone();
     this.Player = (Point)player.Clone();
     this.Opponent = (Point)opponent.Clone();
     this.previousPlayerMove = previousplayerMove;
 }
Ejemplo n.º 3
0
 private GameState getStateAfterMove(Move m)
 {
     return new GameState(   executeMove((int[,])Map.Clone(), m),
                             (m.Player == 0 ? m.Destination : Player),
                             (m.Player == 1 ? m.Destination : Opponent),
                             (m.Player == 0 ? m : previousPlayerMove)
                             );
 }
Ejemplo n.º 4
0
 private int[,] executeMove(int[,] board, Move m)
 {
     board[m.Destination.X, m.Destination.Y] = 1;
     return board;
 }