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

An object layer is a layers composed of objects. More...

#include <tmx/ObjectLayer.h>

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

Public Types

typedef boost::transform_iterator< Adaptor, std::vector< std::unique_ptr< Object > >::const_iteratorconst_iterator
 An object iterator. More...
 

Public Member Functions

 ObjectLayer (const std::string &name, double opacity, bool visible, const std::string &color, DrawOrder order)
 ObjectLayer constructor. More...
 
virtual void accept (const Map &map, LayerVisitor &visitor) const override
 Accept function in the visitor pattern. More...
 
const std::string & getColor () noexcept
 Get the color used to display the objects. More...
 
void addObject (std::unique_ptr< Object > obj)
 Add an object. More...
 
const_iterator begin () const noexcept
 Get the begin iterator on the objects. More...
 
const_iterator end () const noexcept
 Get the end iterator on the objects. 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

An object layer is a layers composed of objects.

An object layer is called object group in the TMX format.

Member Typedef Documentation

typedef boost::transform_iterator<Adaptor, std::vector<std::unique_ptr<Object> >::const_iterator> tmx::ObjectLayer::const_iterator

An object iterator.

Constructor & Destructor Documentation

tmx::ObjectLayer::ObjectLayer ( const std::string &  name,
double  opacity,
bool  visible,
const std::string &  color,
DrawOrder  order 
)
inline

ObjectLayer constructor.

Member Function Documentation

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

Accept function in the visitor pattern.

Parameters
visitorthe visitor

Implements tmx::Layer.

void tmx::ObjectLayer::addObject ( std::unique_ptr< Object obj)
inline

Add an object.

Parameters
objthe object
const_iterator tmx::ObjectLayer::begin ( ) const
inlinenoexcept

Get the begin iterator on the objects.

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

Get the end iterator on the objects.

Returns
the end iterator
const std::string& tmx::ObjectLayer::getColor ( )
inlinenoexcept

Get the color used to display the objects.

Returns
the color to display the objects