28 #include "TmxPropertySet.h"
30 #include "TmxObjectGroup.h"
60 void Parse(
const tinyxml2::XMLNode *tileNode);
120 if (!objectGroup)
throw std::runtime_error (
"Tile has no ObjectGroup on attempt to get ObjectGroup properties. Cannot return null ref.");
127 if (!objectGroup)
throw std::out_of_range (
"Tile has no objectGroup");
140 if (!objectGroup)
throw std::out_of_range (
"Tile has no objectGroup");
147 if (!objectGroup)
throw std::out_of_range (
"Tile has no objectGroup");
160 unsigned int totalDuration;
161 std::vector<AnimationFrame> frames;
176 tileID(-1), duration(0)
182 tileID(tileID), duration(duration)
200 unsigned int duration;
bool HasObjects() const
Returns true if tile has Collision Objects.
Definition: TmxTile.h:132
const Tmx::Object * GetObject(int index) const
Get a single object.
Definition: TmxObjectGroup.h:63
const Tmx::PropertySet & GetProperties() const
Get a set of properties regarding the tile.
Definition: TmxTile.h:106
const Tmx::PropertySet & GetProperties() const
Get the property set.
Definition: TmxObjectGroup.h:75
A class used for holding a list of objects.
Definition: TmxObjectGroup.h:48
std::vector< Tmx::Object * > GetObjects() const
Get set of Collision Objects, convenience function.
Definition: TmxTile.h:125
void Parse(const tinyxml2::XMLNode *tileNode)
Parse a tile node.
Definition: TmxTile.cpp:58
const Tmx::Image * GetImage() const
Returns the tile image if defined.
Definition: TmxTile.h:88
unsigned int GetTotalDuration() const
Returns the total duration of the animation, in milliseconds, or 0 if the tile is not animated...
Definition: TmxTile.h:82
int GetId() const
Get the Id. (relative to the tileset)
Definition: TmxTile.h:63
bool IsAnimated() const
Returns true if the tile is animated (has one or more animation frames)
Definition: TmxTile.h:69
int GetNumObjects() const
Get the number of objects in the list.
Definition: TmxTile.h:145
This class contains a map of properties.
Definition: TmxPropertySet.h:47
Class used for representing a single object from the objectgroup.
Definition: TmxObject.h:48
const Tmx::Object * GetObject(int index) const
Get a single object.
Definition: TmxTile.h:138
const std::vector< Tmx::Object * > & GetObjects() const
Get the whole list of objects.
Definition: TmxObjectGroup.h:72
unsigned int GetDuration() const
Get the duration of this frame in milliseconds.
Definition: TmxTile.h:193
Class containing information about an animated tile.
Definition: TmxTile.h:171
int GetTileID() const
Get the tile id of this frame, relative to the containing tileset.
Definition: TmxTile.h:187
AnimationFrame()
This constructor shouldn't be used, ideally.
Definition: TmxTile.h:175
const std::vector< AnimationFrame > & GetFrames() const
Returns the frames of the animation.
Definition: TmxTile.h:100
Class to contain information about every tile in the tileset/tiles element.
Definition: TmxTile.h:51
std::string GetType() const
Returns the object type of the tile.
Definition: TmxTile.h:94
int GetFrameCount() const
Returns the number of frames of the animation. If the tile is not animated, returns 0...
Definition: TmxTile.h:75
A class used for storing information about an image within a tileset.
Definition: TmxImage.h:42
AnimationFrame(int tileID, unsigned int duration)
Create a new animation frame with a specified tile id and duration.
Definition: TmxTile.h:181
int GetNumObjects() const
Get the number of objects in the list.
Definition: TmxObjectGroup.h:66