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";
195 int getParameter(
const char* name,
const int& defValue);
196 bool getParameter(
const char* name,
int& out,
bool obligatory);
197 float getParameter(
const char* name,
const float &defValue);
198 bool getParameter(
const char* name,
float &out,
bool obligatory);
200 bool getParameter(
const char* name,
mgVect2f& out,
bool obligatory);
202 bool getParameter(
const char* name,
mgVect2i& out,
bool obligatory);
210 TimeManager *_timeManager;
219 mutable bool _lastKeyChecked[256];
239 bool _game_help_enabled;
254 bool _invertMouseButtons;
260 Counters _completeCounters;
262 struct GameInfoIndex {
263 GameInfoIndex(
int idx,
int level) : _gameNum(idx), _gameLevel(level) {}
270 bool operator< (
const GameInfoIndex& rs)
const {
271 return _gameLevel == rs._gameLevel ? _gameNum < rs._gameNum : _gameLevel < rs._gameLevel;
275 struct GameInfoIndex_Hash {
276 uint operator()(
const GameInfoIndex& x)
const {
277 return (x._gameNum << 16) + x._gameLevel;
281 struct GameInfoIndex_EqualTo {
282 uint operator()(
const GameInfoIndex& x,
const GameInfoIndex& y)
const {
283 return x._gameNum == y._gameNum && x._gameLevel == y._gameLevel;
289 GameInfoMap _gameInfos;
291 GameInfoIndex _currentGameIndex;
295 bool testAllGamesWin();
303 bool loadState(
bool current =
true);
305 void saveState(
bool force =
false);
312 MinigameConsCallback _callback =
nullptr;
317 #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