ScummVM API documentation
map_tile.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_SHARED_MAPS_MAP_TILE_H
23 #define ULTIMA_SHARED_MAPS_MAP_TILE_H
24 
25 #include "common/array.h"
26 
27 namespace Ultima {
28 namespace Shared {
29 namespace Maps {
30 
31 class MapWidget;
32 
36 class MapTile {
37 public:
38  int _tileId; // Original tile Id
39  int _tileDisplayNum; // Tile number to display. Can differ from tileId, such as tiles in the
40  // city for talking/stealing to merchants showing as ground
41  Common::Array<MapWidget *> _widgets; // Widgets on the tile, if any
42  int _widgetNum; // Widget number of first widget, if any
43  MapWidget *_widget; // Pointer tofirst widget on tile, if any
44  // Dungeon tile flags
45  bool _isDoor, _isSecretDoor;
46  bool _isLadderUp, _isLadderDown;
47  bool _isWall, _isHallway, _isBeams;
48 public:
52  MapTile() : _tileDisplayNum(-1), _tileId(-1), _widgetNum(-1), _widget(0),
53  _isDoor(false), _isSecretDoor(false), _isLadderUp(false), _isLadderDown(false), _isWall(false),
54  _isHallway(false), _isBeams(false) {}
55 
59  virtual ~MapTile() {}
60 
64  virtual void clear();
65 
69  bool isDoor() const { return _isDoor; }
70 
74  bool isWallOrSecretDoor() const { return _isWall || _isSecretDoor; }
75 
79  bool isWallOrDoorway() const { return _isWall || _isDoor || _isSecretDoor; }
80 
84  bool isSolid() const { return !(_isHallway || _isLadderUp || _isLadderDown || _isBeams); }
85 };
86 
87 } // End of namespace Maps
88 } // End of namespace Shared
89 } // End of namespace Ultima
90 
91 #endif
Definition: map_tile.h:36
bool isWallOrDoorway() const
Definition: map_tile.h:79
Definition: array.h:52
bool isWallOrSecretDoor() const
Definition: map_tile.h:74
Definition: detection.h:27
MapTile()
Definition: map_tile.h:52
bool isSolid() const
Definition: map_tile.h:84
Definition: map_widget.h:50
bool isDoor() const
Definition: map_tile.h:69
virtual ~MapTile()
Definition: map_tile.h:59