libtmx  0.4.0
an C++11 library for reading TMX files
Public Types | Public Member Functions | List of all members
tmx::TileLayer Class Reference

A tile layer is a layer with tiles in cells. More...

#include <tmx/TileLayer.h>

Inheritance diagram for tmx::TileLayer:
Inheritance graph
[legend]

Public Types

typedef std::vector< Cell >::const_iterator const_iterator
 A cell iterator. More...
 

Public Member Functions

 TileLayer (const std::string &name, double opacity, bool visible)
 TileLayer constructor. More...
 
virtual void accept (const Map &map, LayerVisitor &visitor) const override
 Accept function in the visitor pattern. More...
 
void addCell (Cell cell)
 Add a cell to the layer. More...
 
const_iterator begin () const noexcept
 Get the begin iterator on the cells. More...
 
const_iterator end () const noexcept
 Get the end iterator on the cells. More...
 
- Public Member Functions inherited from tmx::Layer
 Layer (const std::string &name, double opacity, bool visible)
 Layer constructor. More...
 
virtual ~Layer ()
 Layer destructor. More...
 
const std::string & getName () const noexcept
 Get the name of the layer. More...
 
double getOpacity () const noexcept
 Get the opacity of the layer. More...
 
bool isVisible () const noexcept
 Tell whether the layer is visible. More...
 
- Public Member Functions inherited from tmx::Component
bool hasProperty (const std::string &key) const noexcept
 Tell if the object has a given property. More...
 
const std::string & getProperty (const std::string &key, const std::string &def) const noexcept
 Get a property value. More...
 
bool addProperty (const std::string &key, const std::string &value)
 Add a property. More...
 

Detailed Description

A tile layer is a layer with tiles in cells.

Member Typedef Documentation

A cell iterator.

Constructor & Destructor Documentation

tmx::TileLayer::TileLayer ( const std::string &  name,
double  opacity,
bool  visible 
)
inline

TileLayer constructor.

Member Function Documentation

virtual void tmx::TileLayer::accept ( const Map map,
LayerVisitor visitor 
) const
overridevirtual

Accept function in the visitor pattern.

Parameters
visitorthe visitor

Implements tmx::Layer.

void tmx::TileLayer::addCell ( Cell  cell)
inline

Add a cell to the layer.

Parameters
cellthe cell
const_iterator tmx::TileLayer::begin ( ) const
inlinenoexcept

Get the begin iterator on the cells.

Returns
the begin iterator
const_iterator tmx::TileLayer::end ( ) const
inlinenoexcept

Get the end iterator on the cells.

Returns
the end iterator