playermanager.h 555 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef INCLUDEPLAYERMANAGER_H
  2. #define INCLUDEPLAYERMANAGER_H
  3. #include <Player.h>
  4. #include <QObject>
  5. #include <vector>
  6. class PlayerManager : public QObject
  7. {
  8. Q_OBJECT
  9. private:
  10. explicit PlayerManager(QObject *parent = nullptr);
  11. public:
  12. static PlayerManager& getInstance() {
  13. static PlayerManager instance;
  14. return instance;
  15. }
  16. Player* getPlayer(int id);
  17. int getPlayersNum();
  18. void setPlayersNum(int num);
  19. private:
  20. std::vector<Player> players_;
  21. signals:
  22. public slots:
  23. };
  24. #endif // INCLUDEPLAYERMANAGER_H