File indexing completed on 2024-05-05 04:02:27

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 GAMEPLAYERINTERFACE_H
0008 #define GAMEPLAYERINTERFACE_H
0009 
0010 #include <list>
0011 #include <string>
0012 
0013 enum KBlocks_Player_Action {
0014     PlayerAction_None = 0,
0015     PlayerAction_Move_Left,
0016     PlayerAction_Move_Right,
0017     PlayerAction_Move_Down,
0018     PlayerAction_Push_Down,
0019     PlayerAction_Rotate_CW,
0020     PlayerAction_Rotate_CCW,
0021     PlayerAction_Max_Count
0022 };
0023 
0024 typedef std::list<KBlocks_Player_Action> GamePlayer_ActionList;
0025 
0026 #include "SingleGameInterface.h"
0027 
0028 class GamePlayerInterface
0029 {
0030 public:
0031     GamePlayerInterface() : mpGame(nullptr) {};
0032     virtual ~GamePlayerInterface() {};
0033 
0034 public:
0035     virtual void startGame(SingleGameInterface *) = 0;
0036     virtual void stopGame() = 0;
0037 
0038     virtual void pauseGame(bool) = 0;
0039 
0040     virtual void think(GamePlayer_ActionList *actionList) = 0;
0041 
0042     virtual std::string getName() = 0;
0043 
0044 protected:
0045     SingleGameInterface *mpGame;
0046 };
0047 
0048 #endif //GAMEPLAYERINTERFACE_H