gamemanager.h 798 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. void printAll();
  12. /******************************/
  13. UnitsQueue turn_queue_;
  14. PlayerManager* player_manager_;
  15. int cur_player_id_;
  16. public:
  17. void buildGameTable(int, int);
  18. static GameManager& getInstance() {
  19. static GameManager instance;
  20. return instance;
  21. }
  22. UnitsQueue* getTurnQueue();
  23. void AddToUnitQueue(Unit* unit);
  24. void RmFromUnitQueue(Unit* unit);
  25. Player* getCurrentPlayer();
  26. int getCurPlayerId();
  27. private:
  28. explicit GameManager(QObject *parent = nullptr);
  29. };