gamemanager.h 932 B

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