Click here to Skip to main content
13,259,771 members (55,281 online)
Click here to Skip to main content

Stats

77.8K views
4.1K downloads
36 bookmarked
Posted 4 Aug 2004

A C# implementation of Reversi (Othello) Game for PocketPC and Windows

, 4 Aug 2004
A C# implementation of Reversi (Othello) Game for PocketPC and Windows.
gma.Reversi.dll
gma.Windows.Reversi.exe
install.ini
setup.exe
gma.ARMV4.CAB
gma.Windows.Reversi
gma.Windows.Reversi.csproj.user
Images
0.gif
1.gif
2.gif
3.gif
4.gif
5.gif
Reversi.ico
gma.Mobile.Reversi
gma.Mobile.Reversi.csdproj
gma.Mobile.Reversi.csdproj.user
Images
0.gif
1.gif
2.gif
3.gif
4.gif
5.gif
Reversi.ico
gma.Reversi
gma.Reversi.csproj.user
using System;
using System.Threading; 
using System.Collections;

namespace gma.Reversi
{
	/// <summary>
	/// Zusammenfassung f�r GUIPlayer.
	/// </summary>
	public class GUIPlayer:Player
	{
		Stack boardHistory= new Stack();

		public GUIPlayer(BoardComplex aBoard):base(aBoard)
		{
		}

		public void MakeMove(Point nextMove)
		{
			if (nextMove.Equals(gma.Reversi.Board.NOMOVE)) return;
			if (_board.CurrentPlayer != PlayerColor) return;
			int anAvailableMoveCount=_board.GetAvailableMoves(PlayerColor).Count;
			if (anAvailableMoveCount == 0) return;

			if (_enableUndo) boardHistory.Push(_board.Clone());
			_board.Play(nextMove, PlayerColor, false);
		}

		protected override void _board_OnMoveTransferred(int aNextPlayer, int anAvailableMoveCount)
		{
			return;
		}

		public BoardComplex UndoLastMove()
		{
			if (_enableUndo)
				return (BoardComplex)boardHistory.Pop();
			else return null;
		}

		private bool _enableUndo=false;
		public bool EnabelUndo
		{
			get {return _enableUndo;}
			set {_enableUndo=value;}
		}

	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

George Mamaladze
Software Developer
Germany Germany
Tweeter: @gmamaladze
Google+: gmamaladze
Blog: gmamaladze.wordpress.com

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171114.1 | Last Updated 5 Aug 2004
Article Copyright 2004 by George Mamaladze
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid