Example #1
0
		public bool IsFriendlyAboveLeft( DraughtsBoard board, string identifier, string side )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquareAboveLeft( identifier );

			if( square == null )
				return false;

			if( square.IsOccupied == true
				&& square.OccupyingName == side )
				return true;
		
			return false;
		}
Example #2
0
		public bool CanTakeAboveLeft( DraughtsBoard board, string identifier, string side )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquare( identifier );

			if( square == null )
				return false;

			if( IsEnemyAboveLeft( board, identifier, side ) == true )
			{
				DraughtsSquare tempSquare = ( DraughtsSquare )board.GetSquareAboveLeft( square.Identifier );

				if( tempSquare == null )
					return false;

				return IsAboveLeftClear( board, tempSquare.Identifier );
			}

			return false;
		}
Example #3
0
		public bool IsEnemyGenerallyBelowRight( DraughtsBoard board, string identifier, string side )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquareBelowRight( identifier );

			if( square == null )
				return false;

			do
			{
				if( IsEnemyAboveLeft( board, square.Identifier, side ) == true )
					return true;
				if( IsEnemyAboveRight( board, square.Identifier, side ) == true )
					return true;
				if( IsEnemyBelowLeft( board, square.Identifier, side ) == true )
					return true;
				if( IsEnemyBelowRight( board, square.Identifier, side ) == true )
					return true;

				square = ( DraughtsSquare )board.GetSquareBelowRight( square.Identifier );
			}
			while( square != null );

			return false;
		}
Example #4
0
		public bool IsBelowRightClear( DraughtsBoard board, string identifier )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquareBelowRight( identifier );

			if( square != null && square.IsOccupied == false )
				return true;

			return false;
		}
Example #5
0
		public bool IsEnemyKingBelowRight( DraughtsBoard board, string identifier, string side )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquareBelowRight( identifier );

			if( square == null )
				return false;

			if( square.IsOccupied == true 
				&& square.IsKing == true
				&& square.OccupyingName != side )
				return true;

			return false;
		}
Example #6
0
		public bool IsFriendlyKingBelowLeft( DraughtsBoard board, string identifier, string side )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquare( identifier );

			if( square != null )
				return false;

			DraughtsSquare tempSquare = ( DraughtsSquare )board.GetSquareBelowLeft( square.Identifier );

			if( tempSquare == null )
				return false;

			if( tempSquare.IsOccupied == true
				&& tempSquare.IsKing == true
				&& tempSquare.OccupyingName == side )
				return true;
		
			return false;
		}