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; }
public bool CanTakeBelowRight( DraughtsBoard board, string identifier, string side ) { DraughtsSquare square = ( DraughtsSquare )board.GetSquare( identifier ); if( square == null ) return false; if( IsEnemyBelowRight( board, identifier, side ) == true ) { DraughtsSquare tempSquare = ( DraughtsSquare )board.GetSquareBelowRight( square.Identifier ); if( tempSquare == null ) return false; return IsBelowRightClear( board, tempSquare.Identifier ); } return false; }
public bool IsBelowRightClear( DraughtsBoard board, string identifier ) { DraughtsSquare square = ( DraughtsSquare )board.GetSquareBelowRight( identifier ); if( square != null && square.IsOccupied == false ) return true; return false; }
public bool IsFriendlyKingBelowRight( ref 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; }