Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Checkers for Pocket PC using a Recursive Min-Max Tree

, 19 Jun 2008 CPOL
Checkers/Draughts game for Pocket PC, using the recursive Min-Max tree to calculate moves, coded with C# over the .NET Compact Framework
checkers20_cab.zip
GamesPackage
GamesPackage.csdproj
GamesPackage.csdproj.user
GamesPackage.csproj.user
GamesPackage.resharperoptions
GamesPackage.suo
SoundPPCLibrary
SoundPPCLibrary.csdproj
SoundPPCLibrary.csdproj.user
SoundPPCLibrary.csproj.user
SoundPPCLibrary.resharperoptions
SoundPPCLibrary.suo
BoardEngine
BoardEngine.csdproj
BoardEngine.csdproj.user
BoardEngine.csproj.user
Checkers
001_select_checker_0.wav
002_select_destination_0.wav
003_player_move_0.wav
004_eat_a_player_0.wav
005_end_of_the_board_0.wav
006_game_over_0.wav
007_win_game_0.wav
CHECKER.ico
Checkers.csdproj
Checkers.csdproj.user
Checkers.csproj.user
Checkers.resharper.user
Checkers.resharperoptions
Checkers.suo
checkersico.ico
Thumbs.db
checkers_source.zip
Checkers.csdproj
Checkers.csdproj.user
Checkers.csproj.user
checkersico.ico
001_select_checker_0.wav
002_select_destination_0.wav
003_player_move_0.wav
004_eat_a_player_0.wav
005_end_of_the_board_0.wav
006_game_over_0.wav
007_win_game_0.wav
CHECKER.ico
using System;
using BoardEngine;
using GamesPackage;

namespace Checkers
{
	public interface CheckersPlayer : IPlayer
	{
		PieceColor Color 
		{
			get; set;
		}
	}
	/// <summary>
	/// Summary description for HumanChessPlayer.
	/// </summary>
	public class HumanCheckersPlayer: CheckersPlayer	
	{

		#region private and protected variables
		protected PieceColor _Color;
		
		#endregion

		public PieceColor Color 
		{
			get 
			{
				return  _Color;
			}
			set 
			{
			}
		}
		#region Constructors

		/// <summary>
		/// Creates an instance of the HumanChessPlayer class given its Player Color (Black or White)
		/// </summary>
		/// <param name="color">The piece's color for this player</param>
		/// <param name="board">The board that will be used for playing</param>
		public HumanCheckersPlayer(PieceColor color)
		{
			this._Color = color;			
			
		}

		#endregion
		#region IPlayer Members

		public event PerformMove OnOtherPlayerMovePerformed;

		public void MovedPerformed(IPlayer player, IMove move)
		{
			if (OnOtherPlayerMovePerformed!=null) OnOtherPlayerMovePerformed(player,move);
			// TODO:  Add HumanCheckersPlayer.MovedPerformed implementation
		}

		public void MakeAMove(CheckersMove move) 
		{
			if (OnPerformMove!=null) OnPerformMove(this,move);
		}

		
		public event PlayDelegate OnPlay;
		public void Play(IGameStateForPlayer info)
		{
			if (OnPlay!=null) 
			{
				OnPlay(info);			
			}
		}

		public event GameOverDelegate OnGameOver;
		public void GameOver(bool winner)
		{
			if (OnGameOver!=null) OnGameOver(winner);
		}

		public void GameHalted(Exception cause)
		{
			
		}

		public event GamesPackage.PerformMove OnPerformMove;

		


		public event InvalidMoveDelegate OnInvalidMove;
		public void InvalidMove(IMove move)
		{
			if (OnInvalidMove!=null) OnInvalidMove(move);
			
		}

		#endregion
	}
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Leonardo Paneque
Team Leader
United States United States
Leonardo loves to code with C# and thinks .NET platforms rocks.
He has a Master degree in Computer Sciences and likes to share code and ideas.
Follow on   Twitter

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141216.1 | Last Updated 20 Jun 2008
Article Copyright 2008 by Leonardo Paneque
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid