ScummVM API documentation
q_system.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 PETKA_Q_SYSTEM_H
23#define PETKA_Q_SYSTEM_H
24
25#include "common/ptr.h"
26#include "common/events.h"
27#include "common/stream.h"
28#include "common/list.h"
29#include "common/hashmap.h"
30#include "common/hash-str.h"
31
32#include "petka/objects/object_bg.h"
33
34namespace Petka {
35
36class PetkaEngine;
37class QObjectCase;
38class QObjectCursor;
39class QObjectStar;
40class QObjectPetka;
41class QObjectChapayev;
42class InterfaceSaveLoad;
43class InterfaceSequence;
44class InterfaceMain;
45class InterfaceStartup;
46class InterfacePanel;
47class InterfaceMap;
48class Interface;
49
50class QSystem {
51public:
53 ~QSystem();
54
55 bool init();
56 void load(Common::ReadStream *s);
57 void save(Common::WriteStream *s);
58
59 void update();
60
61 void addMessage(const QMessage &msg);
62 void addMessage(uint16 objId, uint16 opcode, int16 arg1 = 0, int16 arg2 = 0, int16 arg3 = 0, int32 unk = 0, QMessageObject *sender = nullptr);
63 void addMessageForAllObjects(uint16 opcode, int16 arg1 = 0, int16 arg2 = 0, int16 arg3 = 0, int32 unk = 0, QMessageObject *sender = nullptr);
64
65 QMessageObject *findObject(int16 id);
66 QMessageObject *findObject(const Common::String &name);
67
68 QObjectPetka *getPetka() const;
69 QObjectChapayev *getChapay() const;
70 QObjectCursor *getCursor() const;
71 QObjectCase *getCase() const;
72 QObjectStar *getStar() const;
73
74 void startSaveLoad(int id);
75
76 void togglePanelInterface();
77 void toggleMapInterface();
78 void toggleCase();
79
80 void goPrevInterface();
81
82 void setCursorAction(int action);
83
84 void onEvent(const Common::Event &event);
85
86public:
87 PetkaEngine &_vm;
88
90 Common::List<QMessage> _messages;
92 Common::ScopedPtr<InterfaceSaveLoad> _saveLoadInterface;
93 Common::ScopedPtr<InterfaceSequence> _sequenceInterface;
97 Interface *_currInterface;
98 Interface *_prevInterface;
99
100 bool _totalInit;
101 int _fxId;
102 int _musicId;
103
104 int _sceneWidth;
105 int _xOffset;
106 int _reqOffset;
107
108 QObjectBG *_room;
109};
110
111} // End of namespace Petka
112
113#endif
Definition: array.h:52
Definition: list.h:44
Definition: stream.h:385
Definition: ptr.h:572
Definition: str.h:59
Definition: stream.h:77
Definition: interface.h:34
Definition: petka.h:100
Definition: object.h:58
Definition: object_bg.h:40
Definition: object_case.h:29
Definition: heroes.h:74
Definition: object_cursor.h:39
Definition: heroes.h:31
Definition: object_star.h:29
Definition: q_system.h:50
Definition: events.h:218
Definition: base.h:98