From 3d30e1ee9d1c9fb67cca8e3f178ba5fd05a2726e Mon Sep 17 00:00:00 2001 From: fschildt Date: Sat, 27 Sep 2025 18:19:42 +0200 Subject: tetris: use unscoped enums in Tetromino class --- src/games/tetris/Tetromino.hpp | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'src/games/tetris/Tetromino.hpp') diff --git a/src/games/tetris/Tetromino.hpp b/src/games/tetris/Tetromino.hpp index d6d99c6..0f97821 100644 --- a/src/games/tetris/Tetromino.hpp +++ b/src/games/tetris/Tetromino.hpp @@ -5,22 +5,32 @@ #include #include -enum class TetrominoId : uint8_t { - TETROMINO_O = 0, - TETROMINO_S, - TETROMINO_Z, - TETROMINO_T, - TETROMINO_L, - TETROMINO_J, - TETROMINO_I, - TETROMINO_ID_COUNT, - TETROMINO_ID_NONE, -}; -enum class TetrominoRotation {Clockwise = 1, CounterClockwise = 3}; -enum class TetrominoDirection {Left = -1, Right = 1}; - class Tetromino { +public: + enum TetrominoId : uint8_t { + o_piece, + s_piece, + z_piece, + t_piece, + l_piece, + j_piece, + i_piece, + tetromino_id_count, + tetromino_id_none, + }; + + enum TetrominoRotation { + rotate_clockwise = 1, + rotate_counter_clockwise = 3 + }; + + enum TetrominoDirection { + left = -1, + right = 1 + }; + + public: Tetromino() = delete; Tetromino(Board &board); -- cgit v1.2.3