inline les fonctions opérateurs hors classes

This commit is contained in:
2025-02-25 15:10:50 +01:00
parent 59f457c752
commit f0f391ade6
7 changed files with 26 additions and 31 deletions

View File

@@ -21,8 +21,19 @@ enum Color {
};
static const Color FIRST_PIECE_COLOR = PURPLE; // the first color a piece can be
static const Color LAST_PIECE_COLOR = GREEN; // the last color a piece can be
/**
* Returns the first color a piece can take
*/
inline Color firstPieceColor() {
return Color(PURPLE);
}
/**
* Sets the color to the next available piece color
*/
inline void nextPieceColor(Color& color) {
color = (color == GREEN) ? PURPLE : Color(color + 1);
}
static const std::string COLOR_RESET = "\033[38;2;255;255;255m"; // color code to reset the console color
static const std::string COLOR_CODES[] = { // color codes to change the console color