ScummVM API documentation
global.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 STARK_SERVICES_GLOBAL_H
23 #define STARK_SERVICES_GLOBAL_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 
28 namespace Stark {
29 
30 namespace Resources {
31 class Camera;
32 class Floor;
33 class GlobalItemTemplate;
34 class ModelItem;
35 class KnowledgeSet;
36 class Level;
37 class Location;
38 class Root;
39 }
40 
44 class Current {
45 public:
46  Current() :
47  _level(nullptr),
48  _location(nullptr),
49  _floor(nullptr),
50  _camera(nullptr),
51  _interactive(nullptr) {
52  }
53 
54  Resources::Level *getLevel() const { return _level; }
55  Resources::Location *getLocation() const { return _location; }
56  Resources::Floor *getFloor() const { return _floor; }
57  Resources::Camera *getCamera() const { return _camera; }
58  Resources::ModelItem *getInteractive() const { return _interactive; }
59 
60  void setLevel(Resources::Level *level) { _level = level; }
61  void setLocation(Resources::Location *location) { _location = location; }
62  void setFloor(Resources::Floor *floor) { _floor = floor; }
63  void setCamera(Resources::Camera *camera) { _camera = camera; }
64  void setInteractive(Resources::ModelItem *interactive) { _interactive = interactive; }
65 
66 private:
67  Resources::Level *_level;
68  Resources::Location *_location;
69  Resources::ModelItem *_interactive;
70  Resources::Floor *_floor;
71  Resources::Camera *_camera;
72 };
73 
77 class Global {
78 public:
79  Global();
80 
81  Resources::Root *getRoot() const { return _root; }
82  Resources::Level *getLevel() const { return _level; }
83  Current *getCurrent() const { return _current; }
84  bool isFastForward() const { return _fastForward; }
85  uint getMillisecondsPerGameloop() const { return _millisecondsPerGameloop; }
86  Resources::GlobalItemTemplate *getApril() const { return _april; }
87  Resources::KnowledgeSet *getInventory() const { return _inventory; }
88 
89  void setRoot(Resources::Root *root) { _root = root; }
90  void setLevel(Resources::Level *level) { _level = level; }
91  void setCurrent(Current *current) { _current = current; }
92  void setFastForward() { _fastForward = true; }
93  void setNormalSpeed() { _fastForward = false; }
94  void setMillisecondsPerGameloop(uint millisecondsPerGameloop) { _millisecondsPerGameloop = millisecondsPerGameloop; }
95  void setApril(Resources::GlobalItemTemplate *april) { _april = april; }
96  void setInventory(Resources::KnowledgeSet *inventory) { _inventory = inventory; }
97 
99  int32 getCurrentChapter();
100 
102  bool hasInventoryItem(const Common::String &itemName) const;
103 
105  void setCurrentChapter(int32 value);
106 
108  Common::String getCharacterName(int32 id);
109 
110 private:
111  uint _millisecondsPerGameloop;
112  Resources::Root *_root;
113  Resources::Level *_level;
114  Resources::KnowledgeSet *_inventory;
116  Current *_current;
117  bool _fastForward;
118 };
119 
120 } // End of namespace Stark
121 
122 #endif // STARK_SERVICES_GLOBAL_H
Definition: knowledgeset.h:43
Definition: location.h:51
Definition: str.h:59
Definition: global.h:44
Definition: floor.h:124
Definition: item.h:413
Definition: camera.h:47
Definition: console.h:27
Definition: level.h:39
Definition: root.h:42
Definition: global.h:77