Game/Pieces/Piece.cs
/// <summary>
/// General Check if a given coordinate is valid
/// </summary>
/// <param name="board"></param>
/// <param name="coords"></param>
/// <param name="sideCorner"></param>
/// <param name="ignoreOwnPiece">Ignores the check that you can't take over your own pieces</param>
/// <returns></returns>
General Check if a given coordinate is valid
General Check if a given coordinate is valid
protected bool ValidCoordinate(Tile[] board, Coords coords, int sideCorner, bool ignoreOwnPiece = false)
        {
            if (!coords.IsInsideBoard())
                return false;
            if(sideCorner != -1 && Coords.Column() == sideCorner)
                return false;
            if(!ignoreOwnPiece && board.HasPawnOnTile(coords) && board[(int) coords].Piece.Side == Side && board[(int) coords].Piece != this)
                return false;
            return true;
        }
protected bool ValidCoordinate ( Tile [ ] board , Coords coords , int sideCorner , bool ignoreOwnPiece = false ) { if ( ! coords . IsInsideBoard ( ) ) return false ; if ( sideCorner != - 1 && Coords . Column ( ) == sideCorner ) return false ; if ( ! ignoreOwnPiece && board . HasPawnOnTile ( coords ) && board [ ( int ) coords ] . Piece . Side == Side && board [ ( int ) coords ] . Piece != this ) return false ; return true ; }
General Check if a given coordinate is valid
General Check if a given coordinate is valid
None
board
Tile[]
None
coords
Coords
None
sideCorner
int
None
ignoreOwnPiece
bool
Ignores the check that you can't take over your own pieces
Ignores the check that you can ' t take over your own pieces