22 #ifndef QDENGINE_MINIGAMES_ADV_RUNTIME_H 23 #define QDENGINE_MINIGAMES_ADV_RUNTIME_H 25 #include "common/hashmap.h" 27 #include "qdengine/minigames/adv/common.h" 30 class SeekableReadStream;
31 class SeekableWriteStream;
36 class qdEngineInterface;
37 class qdMinigameSceneInterface;
39 class MinigameInterface;
73 static int version() {
77 return _empty && _game._sequenceIndex < 0;
95 friend class TempValue;
102 bool quant(
float dt);
116 bool mouseLeftPressed()
const;
117 bool mouseRightPressed()
const;
118 bool keyPressed(
int vKey,
bool once =
false)
const;
123 float getTime()
const {
127 GameInfo *getCurrentGameInfo()
const {
return _currentGameInfo; };
128 const MinigameData *getScore(
int level,
int game)
const;
130 bool debugMode()
const {
135 return *_textManager;
138 void signal(SystemEvent
id);
139 void event(
int eventID,
const mgVect2f& pos,
int factor = 1);
140 void event(
int eventID,
const mgVect2i& pos,
int factor = 1) {
141 event(eventID,
mgVect2f(pos.x, pos.y), factor);
145 void setCompleteHelpVariant(
int idx);
147 void setGameHelpVariant(
int idx);
150 const char *parameter(
const char *name,
bool required =
true)
const;
151 const char *parameter(
const char *name,
const char *def)
const;
169 float getDepth(
const mgVect3f& pos)
const;
172 QDObject getObject(
const char *name)
const;
174 bool testObject(
const char *name)
const;
179 void setText(
const char *name,
const char *text)
const;
180 void setText(
const char *name,
int toText,
const char *format =
"%d")
const;
186 float rnd(
float min,
float max)
const;
187 int rnd(
int min,
int max)
const;
192 const char *gameListFileName()
const {
193 return "resource/minigames.lst";
196 int getParameter(
const char* name,
const int& defValue);
197 bool getParameter(
const char* name,
int& out,
bool obligatory);
198 float getParameter(
const char* name,
const float &defValue);
199 bool getParameter(
const char* name,
float &out,
bool obligatory);
201 bool getParameter(
const char* name,
mgVect2f& out,
bool obligatory);
203 bool getParameter(
const char* name,
mgVect2i& out,
bool obligatory);
211 TimeManager *_timeManager;
220 mutable bool _lastKeyChecked[256];
240 bool _game_help_enabled;
255 bool _invertMouseButtons;
261 Counters _completeCounters;
263 struct GameInfoIndex {
264 GameInfoIndex(
int idx,
int level) : _gameNum(idx), _gameLevel(level) {}
271 bool operator< (
const GameInfoIndex& rs)
const {
272 return _gameLevel == rs._gameLevel ? _gameNum < rs._gameNum : _gameLevel < rs._gameLevel;
276 struct GameInfoIndex_Hash {
277 uint operator()(
const GameInfoIndex& x)
const {
278 return (x._gameNum << 16) + x._gameLevel;
282 struct GameInfoIndex_EqualTo {
283 uint operator()(
const GameInfoIndex& x,
const GameInfoIndex& y)
const {
284 return x._gameNum == y._gameNum && x._gameLevel == y._gameLevel;
290 GameInfoMap _gameInfos;
292 GameInfoIndex _currentGameIndex;
296 bool testAllGamesWin();
304 bool loadState(
bool current =
true);
306 void saveState(
bool force =
false);
313 MinigameConsCallback _callback =
nullptr;
318 #endif // QDENGINE_MINIGAMES_ADV_RUNTIME_H
Definition: MinigameInterface.h:27
Definition: qd_minigame_interface.h:78
Definition: qd_minigame_interface.h:365
Базовый класс для игровых ресурсов.
Definition: console.h:28
Definition: algorithm.h:29
Definition: EventManager.h:27
Definition: EffectManager.h:35
Интерфейс к динамическому объекту.
Definition: qd_minigame_interface.h:230
Интерфейс к счётчику.
Definition: qd_minigame_interface.h:353
Интерфейс к сцене.
Definition: qd_minigame_interface.h:315
Definition: TextManager.h:35