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
53namespace Wage {
54
55// Import the enum definitions
57
58class Script;
59class Sound;
60
61class World {
62public:
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 _commandsMenuDefault;
109 Common::String _weaponsMenuName;
110 Common::String _fileMenuName;
111 Common::String _fileMenu;
112
113 void addScene(Scene *room) {
114 if (!room->_name.empty()) {
115 Common::String s = room->_name;
116 s.toLowercase();
117 _scenes[s] = room;
118 }
119 _orderedScenes.push_back(room);
120 }
121
122 void addObj(Obj *obj) {
123 Common::String s = obj->_name;
124 s.toLowercase();
125 _objs[s] = obj;
126 obj->_index = _orderedObjs.size();
127 _orderedObjs.push_back(obj);
128 }
129
130 void addChr(Chr *chr) {
131 Common::String s = chr->_name;
132 s.toLowercase();
133 _chrs[s] = chr;
134 chr->_index = _orderedChrs.size();
135 _orderedChrs.push_back(chr);
136 }
137
138 void addSound(Sound *sound);
139};
140
141} // End of namespace Wage
142
143#endif
size_type size() const
Definition: array.h:316
void push_back(const T &element)
Definition: array.h:181
Definition: hashmap.h:85
Definition: macresman.h:126
Definition: path.h:52
Definition: str.h:59
Definition: entities.h:131
Definition: entities.h:232
Definition: entities.h:301
Definition: script.h:52
Definition: sound.h:52
Definition: wage.h:128
Definition: world.h:61