/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize () { gamegrid = new GameGrid (); winner = null; redPlayer = new HumanPlayer (GameGrid.Token.RED, gamegrid); bluePlayer = new ComputerPlayer (GameGrid.Token.BLUE, gamegrid); SwitchPlayer (); // defaults to red base.Initialize (); }
public Player (GameGrid.Token color, GameGrid grid) { this.color = color; this.grid = grid; }
// copy constructor public GameGrid (GameGrid original) { _grid = (Token[,])original._grid.Clone (); tops = (int[])original.tops.Clone (); moves = new Stack<int> (original.moves); }
public ComputerPlayer (GameGrid.Token color, GameGrid grid) : base (color, grid) { }
public HumanPlayer (GameGrid.Token color, GameGrid grid) : base (color, grid) { }