ScummVM API documentation
mapmgr.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 ULTIMA4_MAP_MAPMGR_H
23#define ULTIMA4_MAP_MAPMGR_H
24
25#include "ultima/ultima4/map/map.h"
26
27namespace Ultima {
28namespace Ultima4 {
29
30class City;
31class ConfigElement;
32class Debug;
33class Dungeon;
34struct PersonRole;
35struct Portal;
36class Shrine;
37
38/*
39 * The map manager is responsible for loading and keeping track of the
40 * various maps.
41 */
42
43#define MAP_NONE 255
44#define MAP_WORLD 0
45#define MAP_CASTLE_OF_LORD_BRITISH 1
46#define MAP_LYCAEUM 2
47#define MAP_EMPATH_ABBEY 3
48#define MAP_SERPENTS_HOLD 4
49#define MAP_MOONGLOW 5
50#define MAP_BRITAIN 6
51#define MAP_JHELOM 7
52#define MAP_YEW 8
53#define MAP_MINOC 9
54#define MAP_TRINSIC 10
55#define MAP_SKARABRAE 11
56#define MAP_MAGINCIA 12
57#define MAP_PAWS 13
58#define MAP_BUCCANEERS_DEN 14
59#define MAP_VESPER 15
60#define MAP_COVE 16
61#define MAP_DECEIT 17
62#define MAP_DESPISE 18
63#define MAP_DESTARD 19
64#define MAP_WRONG 20
65#define MAP_COVETOUS 21
66#define MAP_SHAME 22
67#define MAP_HYTHLOTH 23
68#define MAP_ABYSS 24
69#define MAP_SHRINE_HONESTY 25
70#define MAP_SHRINE_COMPASSION 26
71#define MAP_SHRINE_VALOR 27
72#define MAP_SHRINE_JUSTICE 28
73#define MAP_SHRINE_SACRIFICE 29
74#define MAP_SHRINE_HONOR 30
75#define MAP_SHRINE_SPIRITUALITY 31
76#define MAP_SHRINE_HUMILITY 32
77#define MAP_BRICK_CON 33
78#define MAP_BRIDGE_CON 34
79#define MAP_BRUSH_CON 35
80#define MAP_CAMP_CON 36
81#define MAP_DNG0_CON 37
82#define MAP_DNG1_CON 38
83#define MAP_DNG2_CON 39
84#define MAP_DNG3_CON 40
85#define MAP_DNG4_CON 41
86#define MAP_DNG5_CON 42
87#define MAP_DNG6_CON 43
88#define MAP_DUNGEON_CON 44
89#define MAP_FOREST_CON 45
90#define MAP_GRASS_CON 46
91#define MAP_HILL_CON 47
92#define MAP_INN_CON 48
93#define MAP_MARSH_CON 49
94#define MAP_SHIPSEA_CON 50
95#define MAP_SHIPSHIP_CON 51
96#define MAP_SHIPSHOR_CON 52
97#define MAP_SHORE_CON 53
98#define MAP_SHORSHIP_CON 54
99#define MAP_CAMP_DNG 55
100#define MAP_CASTLE_OF_LORD_BRITISH2 100
101#define MAP_SCUMMVM 101
102
106class MapMgr {
107public:
108 static MapMgr *getInstance();
109 static void destroy();
110
111 Map *get(MapId id);
112 Map *initMap(Map::Type type);
113 void unloadMap(MapId id);
114
115private:
116 MapMgr();
117 ~MapMgr();
118
119 void registerMap(Map *map);
120
121 Map *initMapFromConf(const ConfigElement &mapConf);
122 void initCityFromConf(const ConfigElement &cityConf, City *city);
123 PersonRole *initPersonRoleFromConf(const ConfigElement &cityConf);
124 Portal *initPortalFromConf(const ConfigElement &portalConf);
125 void initShrineFromConf(const ConfigElement &shrineConf, Shrine *shrine);
126 void initDungeonFromConf(const ConfigElement &dungeonConf, Dungeon *dungeon);
127 void initDungeonRoom(Dungeon *dng, int room);
128 void createMoongateFromConf(const ConfigElement &moongateConf);
129 int initCompressedChunkFromConf(const ConfigElement &compressedChunkConf);
130
131 static MapMgr *_instance;
132 Common::Array<Map *> _mapList;
133};
134
135#define mapMgr (MapMgr::getInstance())
136
137} // End of namespace Ultima4
138} // End of namespace Ultima
139
140#endif
Definition: array.h:52
Definition: city.h:41
Definition: config.h:126
Definition: dungeon.h:120
Definition: map.h:134
Definition: mapmgr.h:106
Definition: shrine.h:34
Definition: city.h:33
Definition: portal.h:53