ScummVM API documentation
common.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef QDENGINE_MINIGAMES_ADV_COMMON_H
23 #define QDENGINE_MINIGAMES_ADV_COMMON_H
24 
25 #include "qdengine/qd_fwd.h"
26 #include "qdengine/qdcore/qd_minigame_interface.h"
27 
28 namespace QDEngine {
29 
30 typedef mgVect3<int> mgVect3i;
31 
32 using namespace std;
33 
34 class QDObject {
36 
37 #ifdef _DEBUG
38  Common::String name_;
39 #endif
40 
41 public:
42  static QDObject ZERO;
43 
44  QDObject(qdMinigameObjectInterface* obj = 0, const char* name = "") : _obj(obj) {
45 #ifdef _DEBUG
46  name_ = name;
47 #endif
48  }
49 
50  const char *getName() const; // DEBUG ONLY
51  bool hit(const mgVect2f& point) const;
52  float depth() const;
53 
54  void setState(const char* name);
55 
56  bool operator==(const QDObject& obj) const {
57  return _obj == obj._obj;
58  }
59  bool operator==(const qdMinigameObjectInterface* obj) const {
60  return _obj == obj;
61  }
62 
63  operator qdMinigameObjectInterface* () const {
64  return _obj;
65  }
66  qdMinigameObjectInterface* operator->() const {
67  return _obj;
68  }
69 };
70 
72 
76 
77 class MinigameManager;
78 extern MinigameManager *g_runtime;
79 
80 int getParameter(const char* name, const int& defValue);
81 bool getParameter(const char* name, int& out, bool obligatory);
82 float getParameter(const char* name, const float &defValue);
83 bool getParameter(const char* name, float &out, bool obligatory);
84 mgVect2f getParameter(const char* name, const mgVect2f& defValue);
85 bool getParameter(const char* name, mgVect2f& out, bool obligatory);
86 mgVect2i getParameter(const char* name, const mgVect2i& defValue);
87 bool getParameter(const char* name, mgVect2i& out, bool obligatory);
88 
89 
90 enum SystemEvent {
91  EVENT_TIME_1_SECOND_TICK,
92  EVENT_TIME_10_SECOND_TICK,
93  EVENT_TIME_60_SECOND_TICK,
94  EVENT_TIME_10_SECOND_LEFT,
95  EVENT_TIME_LESS_10_SECOND_LEFT_SECOND_TICK,
96  EVENT_TIME_OUT,
97  EVENT_GAME_LOSE,
98  EVENT_GAME_WIN,
99  SYSTEM_EVENTS_SIZE
100 };
101 
102 } // namespace QDEngine
103 
104 #endif // QDENGINE_MINIGAMES_ADV_COMMON_H
Definition: str.h:59
Definition: common.h:34
Definition: RunTime.h:94
Базовый класс для игровых ресурсов.
Definition: console.h:28
Интерфейс к динамическому объекту.
Definition: qd_minigame_interface.h:230
Интерфейс к счётчику.
Definition: qd_minigame_interface.h:353
Definition: algorithm.h:37