ScrambleSquaresSolver/Models/Grid.cs
/// <summary>
/// Returns true if the coordinates are a legal spot for the provided tile.
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="tile"></param>
/// <returns></returns>
Returns true if the coordinates are a legal spot for the provided tile.
Returns true if the coordinates are a legal spot for the provided tile .
public bool IsLegalSpot(int x, int y, Tile tile)
        {
            if (GetSpotAbove(x, y)?.BottomSide?.IsLegalMatch(tile.TopSide) == false)
                return false;
            if (GetSpotBelow(x, y)?.TopSide?.IsLegalMatch(tile.BottomSide) == false)
                return false;
            if (GetSpotRight(x, y)?.LeftSide?.IsLegalMatch(tile.RightSide) == false)
                return false;
            if (GetSpotLeft(x, y)?.RightSide?.IsLegalMatch(tile.LeftSide) == false)
                return false;
            return true;
        }
public bool IsLegalSpot ( int x , int y , Tile tile ) { if ( GetSpotAbove ( x , y ) ? . BottomSide ? . IsLegalMatch ( tile . TopSide ) == false ) return false ; if ( GetSpotBelow ( x , y ) ? . TopSide ? . IsLegalMatch ( tile . BottomSide ) == false ) return false ; if ( GetSpotRight ( x , y ) ? . LeftSide ? . IsLegalMatch ( tile . RightSide ) == false ) return false ; if ( GetSpotLeft ( x , y ) ? . RightSide ? . IsLegalMatch ( tile . LeftSide ) == false ) return false ; return true ; }
Returns true if the coordinates are a legal spot for the provided tile.
Returns true if the coordinates are a legal spot for the provided tile .
None
x
int
None
y
int
None
tile
Tile
None