ScummVM API documentation
map.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 ULTIMA_ULTIMA1_MAPS_MAP_H
23 #define ULTIMA_ULTIMA1_MAPS_MAP_H
24 
25 #include "ultima/shared/maps/map.h"
26 #include "ultima/shared/maps/map_widget.h"
27 #include "ultima/ultima1/maps/map_base.h"
28 
29 namespace Ultima {
30 namespace Ultima1 {
31 
32 class Ultima1Game;
33 
34 namespace Maps {
35 
36 enum MapType {
37  MAP_OVERWORLD = 0, MAP_CITY = 1, MAP_CASTLE = 2, MAP_DUNGEON = 3, MAP_UNKNOWN = 4
38 };
39 
40 enum MapIdent {
41  MAPID_OVERWORLD = 0
42 };
43 
44 class Ultima1Map;
45 class MapCity;
46 class MapCastle;
47 class MapDungeon;
48 class MapOverworld;
49 
54  uint _water;
55  uint _grass;
56  uint _woods;
57 
61  SurroundingTotals() : _water(0), _grass(0), _woods(0) {}
62 
66  void load(Ultima1Map *map);
67 };
68 
72 class Ultima1Map : public Shared::Maps::Map {
73 private:
74 // Ultima1Game *_game;
75  MapCity *_mapCity;
76  MapCastle *_mapCastle;
77  MapDungeon *_mapDungeon;
78  MapOverworld *_mapOverworld;
79 public:
80  MapType _mapType; // Type of map
81  Point _worldPos; // Point in the world map, updated when entering locations
82  uint _moveCounter; // Movement counter
83 public:
87  Ultima1Map(Ultima1Game *game);
88 
92  ~Ultima1Map() override;
93 
97  void clear() override;
98 
102  void load(Shared::Maps::MapId mapId) override;
103 
107  void synchronize(Common::Serializer &s) override;
108 
112  #define PASS_METHOD(NAME) void NAME() { static_cast<MapBase *>(_mapArea)->NAME(); }
113  PASS_METHOD(board)
114  PASS_METHOD(cast)
115  PASS_METHOD(drop)
116  PASS_METHOD(enter)
117  PASS_METHOD(get)
118  PASS_METHOD(hyperjump)
119  PASS_METHOD(inform)
120  PASS_METHOD(climb)
121  PASS_METHOD(open)
122  PASS_METHOD(steal)
123  PASS_METHOD(talk)
124  PASS_METHOD(unlock)
125  PASS_METHOD(view)
126  PASS_METHOD(disembark)
127 
128  void attack(int direction, int effectId) {
129  static_cast<MapBase *>(_mapArea)->attack(direction, effectId);
130  }
131 
135  void dropCoins(uint amount);
136 
140  MapOverworld *getOverworldMap() { return _mapOverworld; }
141 };
142 
143 } // End of namespace Maps
144 } // End of namespace Ultima1
145 } // End of namespace Ultima
146 
147 #endif
Definition: map.h:46
Definition: map_dungeon.h:48
Definition: map_city_castle.h:135
Definition: serializer.h:79
Definition: map_base.h:39
Definition: detection.h:27
Definition: map_overworld.h:35
Definition: map_city_castle.h:176
Definition: rect.h:45
Definition: game.h:42
MapOverworld * getOverworldMap()
Definition: map.h:140