Compare commits

..

2 commits

Author SHA1 Message Date
A.M. Rowsell
5359d0fb05
doxygen: Trying to get the Doxygen output looking like I want 2025-09-16 13:01:55 -04:00
A.M. Rowsell
ab26479c3c
docs: Documented more of the Board class 2025-09-16 13:01:30 -04:00
2 changed files with 62 additions and 14 deletions

View file

@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "FrznChessboard MCU Code"
PROJECT_NAME = FrznChessboard
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
@ -54,7 +54,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewers a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "All the code for the MCU inside the chessboard"
PROJECT_BRIEF = "PIC32MX code inside the chessboard"
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
@ -67,7 +67,7 @@ PROJECT_LOGO = /home/amr/Pictures/frznchess_pawn_30.png
# when the HTML document is shown. Doxygen will copy the logo to the output
# directory.
PROJECT_ICON =
PROJECT_ICON = ../../Pictures/frznchess_pawn_30.png
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
@ -534,7 +534,7 @@ TIMESTAMP = DATETIME
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = YES
EXTRACT_ALL = NO
# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
# be included in the documentation.
@ -991,7 +991,8 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = /home/amr/MPLABXProjects/chessmcu.X
INPUT = "./README.md ./" \
/home/amr/MPLABXProjects/chessmcu.X
# This tag can be used to specify the character encoding of the source files
# that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses
@ -1456,7 +1457,8 @@ HTML_STYLESHEET =
# documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css
HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css \
doxygen-awesome-css/doxygen-awesome-sidebar-only.css
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
@ -1490,7 +1492,7 @@ HTML_COLORSTYLE = LIGHT
# Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 249
HTML_COLORSTYLE_HUE = 208
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use gray-scales only. A
@ -1498,7 +1500,7 @@ HTML_COLORSTYLE_HUE = 249
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 64
HTML_COLORSTYLE_SAT = 158
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
@ -1851,7 +1853,7 @@ SHOW_ENUM_VALUES = NO
# Minimum value: 0, maximum value: 1500, default value: 250.
# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 250
TREEVIEW_WIDTH = 600
# If the EXT_LINKS_IN_WINDOW option is set to YES, Doxygen will open links to
# external symbols imported via tag files in a separate window.
@ -1902,7 +1904,7 @@ FORMULA_MACROFILE =
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
USE_MATHJAX = YES
# With MATHJAX_VERSION it is possible to specify the MathJax version to be used.
# Note that the different versions of MathJax have different requirements with
@ -1913,7 +1915,7 @@ USE_MATHJAX = NO
# The default value is: MathJax_2.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_VERSION = MathJax_2
MATHJAX_VERSION = MathJax_3
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. For more details about the output format see MathJax
@ -2247,7 +2249,7 @@ LATEX_EMOJI_DIRECTORY =
# readers/editors.
# The default value is: NO.
GENERATE_RTF = YES
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of

View file

@ -44,7 +44,9 @@ struct Square;
*/
class Board {
private:
std::vector<std::vector<std::unique_ptr<Piece>>> boardGrid; /**< This holds the game state. It is a 2D vector of Piece types, or nullptr for empty squares @image html boardGrid.png "Logical diagram of boardGrid vector" */
std::vector<std::vector<std::unique_ptr<Piece>>> boardGrid; /**< This holds the game state.
* It is a 2D vector of Piece types, or nullptr for empty squares
* @image html boardGrid.svg "Logical diagram of boardGrid vector" */
Players playerTurn;
// let's get super object-oriented, baby
// these help the getters and setters access the boardGrid
@ -108,15 +110,59 @@ class Board {
return at(sq) == nullptr;
}
/** A function to setup the initial board
*
* This initializes the boardGrid with the black and white pieces
* in their normal starting positions. All empty squares are set
* to nullptr.
*/
void setupInitialPosition();
/** This function sets the entire board to nullptr
*
* This should, if I understand correctly, destroy
* all the Piece instances that existed because they will no longer
* have any owners, and smart pointers should auto destruct.
*/
void clearBoard();
/** This does the actual moving of a piece from one square to another
*
* Beware! This function does \e not validate if the move is legal. It
* will simply do whatever it is told to do. So only call this once you
* are positive the move is legal.
* Moves to an empty square are simple, just move the Piece to that other
* square. Captures have to also take note of the piece type captured
* and add it to the total captured by that side. This should also destroy
* the smart pointer automatically.
* @param from The originating square for the Piece that is moving
* @param to And of course, where it will end up
*/
void movePiece(Square from, Square to);
void nextTurn();
/** This function takes a standard FEN string and sets up the board.
*
* FEN is a standard notation that describes only an exact position and
* other important things like whose turn it is, whether sides can castle,
* but it does \e not include the move history of the game. This makes it
* a simpler format for sharing particular interesting positions.
*
* @param strFEN A std::string that contains a valid FEN position
* @return 0 on success, -1 if the FEN string is invalid
*/
int setupFromFEN(std::string strFEN);
bool isInBounds(Square square) const;
// serial shift register stuff
uint64_t serialBoard = 0xFFFF00000000FFFF; // opening position
/** This takes an incoming serial stream and detects if anything has moved.
*
* The input is one bit per piece, so it can only detect the presence or
* absence of pieces on any particular square. This is the crux of our design,
* using simpler reed switches for detection instead of RFID or any other two-way
* communication with the pieces. This moves a lot of the complexity into software,
* though a lot of the complexity is actually quite easy to deal with from a software
* point of view.
*
* @param incomingBoard A 64-bit value, representing 1 bit per piece.
*/
void deserializeBoard(uint64_t incomingBoard);
};