gamemanager.h 776 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include <vector>
  2. #include <hotseatgame/unitsqueue.h>
  3. #include <playermanager.h>
  4. class Cell;
  5. class GameManager : public QObject
  6. {
  7. private:
  8. std::vector< std::vector< Cell* > > game_table_;
  9. int col_table_size_, row_table_size_;
  10. void generateTable();
  11. /******************************/
  12. UnitsQueue turn_queue_;
  13. PlayerManager* player_manager_;
  14. int cur_player_id_;
  15. public:
  16. void buildGameTable(int, int);
  17. static GameManager& getInstance() {
  18. static GameManager instance;
  19. return instance;
  20. }
  21. UnitsQueue* getTurnQueue();
  22. void AddToUnitQueue(Unit* unit);
  23. void RmFromUnitQueue(Unit* unit);
  24. Player* getCurrentPlayer();
  25. int getCurPlayerId();
  26. private:
  27. explicit GameManager(QObject *parent = nullptr);
  28. };