Changeset 40 for trunk


Ignore:
Timestamp:
Jul 23, 2006, 10:52:40 AM (13 years ago)
Author:
jtv
Message:

More documentation

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/c_abi.h

    r34 r40  
    2727#endif
    2828
     29/// Type used to refer to a playing field in the C API.
     30/** What's actually in a Minefield doesn't matter while using the C API; use the
     31 * provided functions instead.
     32 *
     33 * Since the underlying data structure is really a C++ class, it would be
     34 * technically difficult to access it directly anyway.
     35 */
    2936typedef void Minefield;
    3037
  • trunk/include/gamelogic.hxx

    r34 r40  
    2727struct Coords
    2828{
     29  /// Location's "y coordinate"
    2930  int row;
     31  /// Location's "x coordinate"
    3032  int col;
     33  /// Coordinates pair of square at given row and column
    3134  Coords(int Row, int Col) : row(Row), col(Col) {}
     35  /// Total-order comparison for sorting purposes
     36  /** Compares locations of two squares.  Although it's not essential, this is
     37   * done in the same way that addresses of elements in a two-dimensional C
     38   * array compare.
     39   */
    3240  bool operator<(const Coords &rhs) const throw ()
    3341    { return (rhs.row < row) || (rhs.row==row && rhs.col<col); }
     
    3846struct Boom
    3947{
     48  /// Coordinates of field touched in fatal move
    4049  Coords position;
     50  /// Number of moves made, including the fatal one
    4151  int moves;
     52  /// Was the field in question actually mined?
    4253  bool mined;
     54  /// Compose "you die" information to be thrown as exception
    4355  Boom(Coords pos, int mov, bool mine) : position(pos), moves(mov), mined(mine)
    4456    {}
     
    7890   * surrounding patches whose state becomes obvious.  Boom is thrown if the
    7991   * given patch is actually mined.
     92   * @param row "y coordinate" of field
     93   * @param col "x coordinate" of field
    8094   * @param changes will receive a list of all patches revealed by this move
    8195   * @param as_mine indicates whether user thinks this patch is mined
     
    99113  char status_at(int row, int col) const;
    100114
     115  /// Number of rows making up this Lake
    101116  const int rows() const throw () { return m_rows; }
     117  /// Number of columns making up this Lake
    102118  const int cols() const throw () { return m_cols; }
    103119
Note: See TracChangeset for help on using the changeset viewer.