22 #ifndef ULTIMA_SHARED_MAPS_MAP_H 23 #define ULTIMA_SHARED_MAPS_MAP_H 25 #include "common/array.h" 26 #include "common/serializer.h" 27 #include "ultima/shared/core/rect.h" 28 #include "ultima/shared/maps/map_base.h" 29 #include "ultima/shared/maps/map_widget.h" 30 #include "ultima/shared/maps/map_tile.h" 40 #define REGISTER_WIDGET(NAME) if (name == #NAME) return new Widgets::NAME(_game, this) 41 #define DECLARE_WIDGET(NAME) const char *getClassName() const override { return #NAME; } 53 Map() : _mapArea(nullptr) {}
63 virtual void load(MapId mapId);
88 return _mapArea->
getTileAt(pt, tile, includePlayer);
112 return _mapArea->
width();
120 return _mapArea->
height();
185 return _mapArea->_tilesPerOrigTile;
193 return _mapArea->_name;
201 return _mapArea->_playerWidget;
234 return _mapArea->
update();
virtual void shiftViewport(const Point &delta)
Definition: map_tile.h:36
MapWidget * createWidget(const Common::String &name)
Definition: map.h:78
virtual void setTileAt(const Point &pt, uint tileId)
size_t width() const
Definition: map.h:110
Point getPosition() const
Definition: map.h:126
bool isMapWrapped() const
Definition: map.h:224
Point getTilesPerOrigTile() const
Definition: map.h:183
Point getDirectionDelta() const
bool changeLevel(int delta)
Definition: map.h:208
size_t height() const
Definition: map_base.h:224
virtual bool changeLevel(int delta)
Definition: map_base.h:199
Point getPosition() const
void setDirection(Direction dir)
Point getDirectionDelta() const
Definition: map.h:158
uint getLevel() const
Definition: map.h:216
Point getDeltaPosition(const Point &delta)
Definition: map.h:166
void castSpell(uint spellId)
Definition: map.h:240
Definition: serializer.h:79
Definition: detection.h:27
void update()
Definition: map.h:232
void setDirection(Direction dir)
Definition: map.h:150
void shiftViewport(const Point &delta)
Definition: map.h:174
void setPosition(const Point &pt)
virtual void castSpell(uint spell)=0
Direction getDirection() const
Point getViewportPosition(const Point &viewportSize)
Definition: map.h:102
virtual void synchronize(Common::Serializer &s)
virtual ~Map()
Definition: map.h:58
void setPosition(const Point &pt)
Definition: map.h:134
void setTileAt(const Point &pt, uint tileId)
Definition: map.h:94
virtual uint getLevel() const
Definition: map_base.h:204
Map()
Definition: map.h:53
Common::String getName() const
Definition: map.h:191
Direction getDirection() const
Definition: map.h:142
Definition: map_base.h:47
void getTileAt(const Point &pt, MapTile *tile, bool includePlayer=true)
Definition: map.h:86
virtual bool isMapWrapped() const
Definition: map_base.h:209
virtual MapWidget * createWidget(const Common::String &name)=0
virtual void load(MapId mapId)
virtual void getTileAt(const Point &pt, MapTile *tile, bool includePlayer=true)
MapWidget * getPlayerWidget() const
Definition: map.h:199
virtual Point getViewportPosition(const Point &viewportSize)
virtual Point getDeltaPosition(const Point &delta)
size_t width() const
Definition: map_base.h:219
size_t height() const
Definition: map.h:118