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 ULTIMA4_MAP_MAP_TILE_H
23#define ULTIMA4_MAP_MAP_TILE_H
24
25#include "ultima/ultima4/core/types.h"
26#include "ultima/ultima4/map/tile.h"
27
28namespace Ultima {
29namespace Ultima4 {
30
34class MapTile {
35public:
36 MapTile() : _id(0), _frame(0), _freezeAnimation(false) {
37 }
38 MapTile(const TileId &i, byte f = 0) : _id(i), _frame(f), _freezeAnimation(false) {
39 }
40
41 TileId getId() const {
42 return _id;
43 }
44 byte getFrame() const {
45 return _frame;
46 }
47 bool getFreezeAnimation() const {
48 return _freezeAnimation;
49 }
50
51 bool operator==(const MapTile &m) const {
52 return _id == m._id;
53 }
54 bool operator==(const TileId &i) const {
55 return _id == i;
56 }
57 bool operator!=(const MapTile &m) const {
58 return _id != m._id;
59 }
60 bool operator!=(const TileId &i) const {
61 return _id != i;
62 }
63 bool operator<(const MapTile &m) const {
64 return _id < m._id; // for Std::less
65 }
66
70 Direction getDirection() const;
71 bool setDirection(Direction d);
72
73 const Tile *getTileType() const;
74
75 // Properties
76 TileId _id;
77 byte _frame;
78 bool _freezeAnimation;
79};
80
81} // End of namespace Ultima4
82} // End of namespace Ultima
83
84#endif
Definition: map_tile.h:34
Direction getDirection() const
Definition: tile.h:64