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; }
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; }
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) ); }
private int[,] executeMove(int[,] board, Move m) { board[m.Destination.X, m.Destination.Y] = 1; return board; }