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
28namespace QDEngine {
29
30class MinigameManager;
31
32typedef mgVect3<int> mgVect3i;
33
34class QDObject {
36
37#ifdef _DEBUG
38 Common::String _name;
39#endif
40
41public:
42 QDObject(qdMinigameObjectInterface* obj = 0, const char* name = "") : _obj(obj) {
43#ifdef _DEBUG
44 _name = name;
45#endif
46 }
47
48 const char *getName() const; // DEBUG ONLY
49 bool hit(const mgVect2f& point) const;
50 float depth(MinigameManager *runtime) const;
51
52 void setState(const char* name);
53
54 bool operator==(const QDObject& obj) const {
55 return _obj == obj._obj;
56 }
57 bool operator==(const qdMinigameObjectInterface* obj) const {
58 return _obj == obj;
59 }
60
61 operator qdMinigameObjectInterface* () const {
62 return _obj;
63 }
64 qdMinigameObjectInterface* operator->() const {
65 return _obj;
66 }
67};
68
70
74
75class MinigameManager;
76extern MinigameManager *g_runtime;
77
78enum SystemEvent {
79 EVENT_TIME_1_SECOND_TICK,
80 EVENT_TIME_10_SECOND_TICK,
81 EVENT_TIME_60_SECOND_TICK,
82 EVENT_TIME_10_SECOND_LEFT,
83 EVENT_TIME_LESS_10_SECOND_LEFT_SECOND_TICK,
84 EVENT_TIME_OUT,
85 EVENT_GAME_LOSE,
86 EVENT_GAME_WIN,
87 SYSTEM_EVENTS_SIZE
88};
89
90} // namespace QDEngine
91
92#endif // QDENGINE_MINIGAMES_ADV_COMMON_H
Definition: str.h:59
Definition: RunTime.h:94
Definition: common.h:34
Интерфейс к счётчику.
Definition: qd_minigame_interface.h:353
Интерфейс к динамическому объекту.
Definition: qd_minigame_interface.h:230
Базовый класс для игровых ресурсов.
Definition: console.h:28