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 const MinigameData *getScore(
int level,
int game)
const;
129 bool debugMode()
const {
134 return *_textManager;
137 void signal(SystemEvent
id);
138 void event(
int eventID,
const mgVect2f& pos,
int factor = 1);
139 void event(
int eventID,
const mgVect2i& pos,
int factor = 1) {
140 event(eventID,
mgVect2f(pos.x, pos.y), factor);
144 void setCompleteHelpVariant(
int idx);
146 void setGameHelpVariant(
int idx);
149 const char *parameter(
const char *name,
bool required =
true)
const;
150 const char *parameter(
const char *name,
const char *def)
const;
168 float getDepth(
const mgVect3f& pos)
const;
171 QDObject getObject(
const char *name)
const;
173 bool testObject(
const char *name)
const;
178 void setText(
const char *name,
const char *text)
const;
179 void setText(
const char *name,
int toText,
const char *format =
"%d")
const;
185 float rnd(
float min,
float max)
const;
186 int rnd(
int min,
int max)
const;
191 const char *gameListFileName()
const {
192 return "resource/minigames.lst";
201 TimeManager *_timeManager;
210 mutable bool _lastKeyChecked[256];
230 bool _game_help_enabled;
245 bool _invertMouseButtons;
251 Counters _completeCounters;
253 struct GameInfoIndex {
254 GameInfoIndex(
int idx,
int level) : _gameNum(idx), _gameLevel(level) {}
261 bool operator< (
const GameInfoIndex& rs)
const {
262 return _gameLevel == rs._gameLevel ? _gameNum < rs._gameNum : _gameLevel < rs._gameLevel;
266 struct GameInfoIndex_Hash {
267 uint operator()(
const GameInfoIndex& x)
const {
268 return (x._gameNum << 16) + x._gameLevel;
272 struct GameInfoIndex_EqualTo {
273 uint operator()(
const GameInfoIndex& x,
const GameInfoIndex& y)
const {
274 return x._gameNum == y._gameNum && x._gameLevel == y._gameLevel;
280 GameInfoMap _gameInfos;
282 GameInfoIndex _currentGameIndex;
286 bool testAllGamesWin();
294 bool loadState(
bool current =
true);
296 void saveState(
bool force =
false);
303 MinigameConsCallback _callback =
nullptr;
308 #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