51 lines
1.3 KiB
C++
51 lines
1.3 KiB
C++
// ============================================================================
|
|
// MONOPOLY GAME HEADER
|
|
// ============================================================================
|
|
// Concrete implementation of the Game interface for Monopoly
|
|
|
|
#ifndef MONOPOLY_GAME_H
|
|
#define MONOPOLY_GAME_H
|
|
|
|
#include "../../lib/game.h"
|
|
#include "player.h"
|
|
#include "monopoly_board.h"
|
|
#include "chance.h"
|
|
#include "community_chest.h"
|
|
|
|
/**
|
|
* @brief Monopoly game implementation for the custom console
|
|
*
|
|
* - Button/touch input for actions
|
|
* - Board and player state
|
|
* - Rendering and input handling
|
|
*/
|
|
class MonopolyGame : public Game {
|
|
public:
|
|
MonopolyGame(uint16_t width, uint16_t height, LowLevelRenderer* renderer, LowLevelGUI* gui, InputManager* input_manager);
|
|
void init() override;
|
|
bool update(const InputEvent& event) override;
|
|
void draw() override;
|
|
|
|
|
|
private:
|
|
// Game state and helpers
|
|
Player players[MAX_PLAYERS];
|
|
int players_count;
|
|
int current_player_idx;
|
|
bool has_rolled;
|
|
int double_rolls;
|
|
bool just_sent_to_jail;
|
|
|
|
// UI selection state
|
|
int selected_action; // 0: Roll, 1: Buy, 2: End Turn
|
|
static constexpr int ACTION_COUNT = 3;
|
|
|
|
// Modal games
|
|
Game* active_modal = nullptr;
|
|
int last_dice1 = 0;
|
|
int last_dice2 = 0;
|
|
int modal_property_index = -1;
|
|
};
|
|
|
|
#endif // MONOPOLY_GAME_H
|