Exemplo n.º 1
0
    /// <summary>
    /// Retrieves the details of a coordinate on the board.
    /// </summary>
    /// <param name="coord">Boardcoord value to search for.</param>
    /// <returns></returns>
    public CoordInfo GetCoordInfo(BoardCoord coord)
    {
        if (ContainsCoord(coord))
        {
            return(coordinates[coord]);
        }

        Debug.LogErrorFormat("ERROR: The GameBoard does not contain a CoordInfo for coordinate position: {0}", coord.ToString());
        return(null);
    }
Exemplo n.º 2
0
 /// <summary>
 /// Assert that the current game board contains a specified coordinate.
 /// </summary>
 /// <param name="coord">Coordinate to check.</param>
 /// <returns>True if game board contains the coordinate.</returns>
 public bool AssertContainsCoord(BoardCoord coord)
 {
     if (!board.ContainsCoord(coord))
     {
         Debug.LogErrorFormat("ERROR: {0} is not a valid position on the GameBoard!", coord.ToString());
         return(false);
     }
     return(true);
 }