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 
34 namespace Petka {
35 
36 class PetkaEngine;
37 class QObjectCase;
38 class QObjectCursor;
39 class QObjectStar;
40 class QObjectPetka;
41 class QObjectChapayev;
42 class InterfaceSaveLoad;
43 class InterfaceSequence;
44 class InterfaceMain;
45 class InterfaceStartup;
46 class InterfacePanel;
47 class InterfaceMap;
48 class Interface;
49 
50 class QSystem {
51 public:
52  QSystem(PetkaEngine &vm);
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 
86 public:
87  PetkaEngine &_vm;
88 
90  Common::List<QMessage> _messages;
91  Common::ScopedPtr<InterfaceMain> _mainInterface;
92  Common::ScopedPtr<InterfaceSaveLoad> _saveLoadInterface;
93  Common::ScopedPtr<InterfaceSequence> _sequenceInterface;
94  Common::ScopedPtr<InterfaceStartup> _startupInterface;
95  Common::ScopedPtr<InterfacePanel> _panelInterface;
96  Common::ScopedPtr<InterfaceMap> _mapInterface;
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: object_cursor.h:39
Definition: str.h:59
Definition: stream.h:77
Definition: array.h:52
Definition: list.h:44
Definition: base.h:98
Definition: object_case.h:29
Definition: ptr.h:572
Definition: object_bg.h:40
Definition: heroes.h:74
Definition: object_star.h:29
Definition: interface.h:34
Definition: events.h:199
Definition: heroes.h:31
Definition: object.h:58
Definition: petka.h:83
Definition: stream.h:385
Definition: q_system.h:50
Definition: base.h:27