ScummVM API documentation
world.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  * MIT License:
21  *
22  * Copyright (c) 2009 Alexei Svitkine, Eugene Sandulenko
23  *
24  * Permission is hereby granted, free of charge, to any person
25  * obtaining a copy of this software and associated documentation
26  * files (the "Software"), to deal in the Software without
27  * restriction, including without limitation the rights to use,
28  * copy, modify, merge, publish, distribute, sublicense, and/or sell
29  * copies of the Software, and to permit persons to whom the
30  * Software is furnished to do so, subject to the following
31  * conditions:
32  *
33  * The above copyright notice and this permission notice shall be
34  * included in all copies or substantial portions of the Software.
35  *
36  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43  * OTHER DEALINGS IN THE SOFTWARE.
44  *
45  */
46 
47 #ifndef WAGE_WORLD_H
48 #define WAGE_WORLD_H
49 
50 #include "wage/entities.h"
51 #include "graphics/macgui/macwindowmanager.h"
52 
53 namespace Wage {
54 
55 // Import the enum definitions
57 
58 class Script;
59 class Sound;
60 
61 class World {
62 public:
63  World(WageEngine *engine);
64  ~World();
65 
66  bool loadWorld(Common::MacResManager *resMan);
67  void loadExternalSounds(const Common::Path &fname);
68  Common::String *loadStringFromDITL(Common::MacResManager *resMan, int resourceId, int itemIndex);
69  void move(Obj *obj, Chr *chr);
70  void move(Obj *obj, Scene *scene, bool skipSort = false);
71  void move(Chr *chr, Scene *scene, bool skipSort = false);
72  Scene *getRandomScene();
73  Scene *getSceneAt(int x, int y);
74  bool scenesAreConnected(Scene *scene1, Scene *scene2);
75  const char *getAboutMenuItemName();
76 
77  WageEngine *_engine;
78 
79  Common::String _name;
80  Common::String _aboutMessage;
81  Common::Path _soundLibrary1;
82  Common::Path _soundLibrary2;
83 
84  bool _weaponMenuDisabled;
85  Script *_globalScript;
90  Common::Array<Scene *> _orderedScenes;
91  ObjArray _orderedObjs;
92  ChrArray _orderedChrs;
93  Common::Array<Sound *> _orderedSounds;
94  Graphics::MacPatterns *_patterns;
95  Scene *_storageScene;
96  Chr *_player;
97  int _signature;
98  //List<MoveListener> moveListeners;
99 
100  Common::String *_gameOverMessage;
101  Common::String *_saveBeforeQuitMessage;
102  Common::String *_saveBeforeCloseMessage;
103  Common::String *_revertMessage;
104 
105  Common::String _aboutMenuItemName;
106  Common::String _commandsMenuName;
107  Common::String _commandsMenu;
108  Common::String _weaponsMenuName;
109 
110  void addScene(Scene *room) {
111  if (!room->_name.empty()) {
112  Common::String s = room->_name;
113  s.toLowercase();
114  _scenes[s] = room;
115  }
116  _orderedScenes.push_back(room);
117  }
118 
119  void addObj(Obj *obj) {
120  Common::String s = obj->_name;
121  s.toLowercase();
122  _objs[s] = obj;
123  obj->_index = _orderedObjs.size();
124  _orderedObjs.push_back(obj);
125  }
126 
127  void addChr(Chr *chr) {
128  Common::String s = chr->_name;
129  s.toLowercase();
130  _chrs[s] = chr;
131  chr->_index = _orderedChrs.size();
132  _orderedChrs.push_back(chr);
133  }
134 
135  void addSound(Sound *sound);
136 };
137 
138 } // End of namespace Wage
139 
140 #endif
Definition: script.h:52
Definition: macresman.h:125
Definition: world.h:61
Definition: str.h:59
Definition: path.h:52
Definition: wage.h:126
void push_back(const T &element)
Definition: array.h:142
Definition: sound.h:52
Definition: hashmap.h:85
Definition: entities.h:231
size_type size() const
Definition: array.h:275
Definition: entities.h:300
Definition: debugger.h:28
Definition: entities.h:130