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; }
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; }
public bool IsEnemyGenerallyAboveLeft( DraughtsBoard board, string identifier, string side ) { DraughtsSquare square = ( DraughtsSquare )board.GetSquareAboveLeft( 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.GetSquareAboveLeft( square.Identifier ); } while( square != null ); return false; }
public bool IsAboveLeftClear( DraughtsBoard board, string identifier ) { DraughtsSquare square = ( DraughtsSquare )board.GetSquareAboveLeft( identifier ); if( square != null && square.IsOccupied == false ) return true; return false; }