File indexing completed on 2024-04-21 04:02:08

0001 /***************************************************************************
0002 *   KBlocks, a falling blocks game by KDE                                *
0003 *   SPDX-FileCopyrightText: 2010 Zhongjie Cai <squall.leonhart.cai@gmail.com>       *
0004 *                                                                         *
0005 *   SPDX-License-Identifier: GPL-2.0-or-later
0006 ***************************************************************************/
0007 #ifndef KBLOCKSPLAYMANAGER_H
0008 #define KBLOCKSPLAYMANAGER_H
0009 
0010 #include "GamePlayerInterface.h"
0011 #include "GameLogicInterface.h"
0012 #include "KBlocksSinglePlayer.h"
0013 
0014 class KBlocksPlayManager
0015 {
0016 public:
0017     KBlocksPlayManager(GameLogicInterface *p, int capacity);
0018     ~KBlocksPlayManager();
0019 
0020 public:
0021     bool addGamePlayer(GamePlayerInterface *p, int thinkInterval, int processInterval);
0022     void clearGamePlayer();
0023 
0024     void startGame();
0025     void stopGame();
0026 
0027     void pauseGame(bool flag);
0028 
0029 private:
0030     GameLogicInterface *mpGameLogic = nullptr;
0031 
0032     int mPlayerCount;
0033     int mMaxCapacity;
0034     KBlocksSinglePlayer **maPlayerList;
0035 };
0036 
0037 #endif
0038