inline les fonctions opérateurs hors classes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user