Beispiel #1
0
		/// <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 ();
				
		}
Beispiel #2
0
		public Player (GameGrid.Token color, GameGrid grid)
		{
			this.color = color;
			this.grid = grid;
		}
Beispiel #3
0
		// copy constructor
		public GameGrid (GameGrid original)
		{
			_grid = (Token[,])original._grid.Clone ();
			tops = (int[])original.tops.Clone ();
			moves = new Stack<int> (original.moves);
		}
Beispiel #4
0
		public ComputerPlayer (GameGrid.Token color, GameGrid grid) : base (color, grid)
		{
		}
Beispiel #5
0
		public HumanPlayer (GameGrid.Token color, GameGrid grid) : base (color, grid)
		{
		}