示例#1
0
		public bool IsEnemyGenerallyAboveRight( DraughtsBoard board, string identifier, string side )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquareAboveRight( 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( IsEnemyBelowRight( board, square.Identifier, side ) == true )
					return true;
				if( IsEnemyBelowLeft( board, square.Identifier, side ) == true )
					return true;

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

			return false;
		}
示例#2
0
		public bool CanTakeAboveRight( DraughtsBoard board, string identifier, string side )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquare( identifier );

			if( square == null )
				return false;

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

				if( tempSquare == null )
					return false;

				return IsAboveRightClear( board, tempSquare.Identifier );
			}

			return false;
		}
示例#3
0
		public bool IsAboveRightClear( DraughtsBoard board, string identifier )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquareAboveRight( identifier );

			if( square != null && square.IsOccupied == false )
				return true;
		
			return false;
		}
示例#4
0
		public bool IsFriendlyKingAboveRight( DraughtsBoard board, string identifier, string side )
		{
			DraughtsSquare square = ( DraughtsSquare )board.GetSquareAboveRight( identifier );

			if( square == null )
				return false;

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

			return false;
		}