public bool IsEnemyGenerallyBelowLeft( DraughtsBoard board, string identifier, string side ) { DraughtsSquare square = ( DraughtsSquare )board.GetSquareBelowLeft( 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.GetSquareBelowLeft( square.Identifier ); } while( square != null ); return false; }
public bool IsBelowLeftClear( DraughtsBoard board, string identifier ) { DraughtsSquare square = ( DraughtsSquare )board.GetSquareBelowLeft( identifier ); if( square != null && square.IsOccupied == false ) return true; return false; }
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; }
public bool CanTakeBelowLeft( DraughtsBoard board, string identifier, string side ) { DraughtsSquare square = ( DraughtsSquare )board.GetSquare( identifier ); if( square == null ) return false; if( IsEnemyBelowLeft( board, identifier, side ) == true ) { DraughtsSquare tempSquare = ( DraughtsSquare )board.GetSquareBelowLeft( square.Identifier ); if( tempSquare == null ) return false; return IsBelowLeftClear( board, tempSquare.Identifier ); } return false; }
public bool IsEnemyKingBelowLeft( DraughtsBoard board, string identifier, string side ) { DraughtsSquare square = ( DraughtsSquare )board.GetSquareBelowLeft( identifier ); if( square == null ) return false; if( square.IsOccupied == true && square.IsKing == true && square.OccupyingName != side ) return true; return false; }