Tileson 1.4.0
A helpful json parser for Tiled maps
Loading...
Searching...
No Matches
Public Member Functions | List of all members
tson::WangSet Class Reference

#include <WangSet.hpp>

Public Member Functions

 WangSet ()=default
 
 WangSet (IJson &json, tson::Map *map)
 
bool parse (IJson &json, tson::Map *map)
 
const std::string & getName () const
 
int getTile () const
 
const std::vector< tson::WangTile > & getWangTiles () const
 
const std::vector< tson::WangColor > & getCornerColors () const
 
const std::vector< tson::WangColor > & getEdgeColors () const
 
tson::WangColorgetColor (const std::string &name)
 
const std::vector< tson::WangColor > & getColors () const
 
PropertyCollectiongetProperties ()
 
template<typename T >
get (const std::string &name)
 
tson::PropertygetProp (const std::string &name)
 
const std::string & getClassType () const
 
tson::TiledClassgetClass ()
 

Constructor & Destructor Documentation

◆ WangSet() [1/2]

tson::WangSet::WangSet ( )
inlinedefault

◆ WangSet() [2/2]

tson::WangSet::WangSet ( IJson json,
tson::Map map 
)
inlineexplicit

Member Function Documentation

◆ get()

template<typename T >
T tson::WangSet::get ( const std::string &  name)
inline

A shortcut for getting a property. Alternative to getProperties().getValue<T>("<name>")

Template Parameters
TThe template value
Parameters
nameName of the property
Returns
The actual value, if it exists. Otherwise: The default value of the type.

◆ getClass()

tson::TiledClass * tson::WangSet::getClass ( )
inline

◆ getClassType()

const std::string & tson::WangSet::getClassType ( ) const
inline

◆ getColor()

tson::WangColor * tson::WangSet::getColor ( const std::string &  name)
inline

NB! Will only work with maps created/modified by Tiled v1.5 or later! Gets a color from a wangset by its name.

Parameters
name'name' of WangColor
Returns
The WangColor with the given name or nullptr if it doesn't exist.

◆ getColors()

const std::vector< tson::WangColor > & tson::WangSet::getColors ( ) const
inline

Get Wangset colors (new in Tiled v1.5)

Returns

◆ getCornerColors()

const std::vector< tson::WangColor > & tson::WangSet::getCornerColors ( ) const
inline

'cornercolors': Array of Wang colors

Returns

◆ getEdgeColors()

const std::vector< tson::WangColor > & tson::WangSet::getEdgeColors ( ) const
inline

'edgecolors': Array of Wang colors

Returns

◆ getName()

const std::string & tson::WangSet::getName ( ) const
inline

'name': Name of the Wang set

Returns

◆ getProp()

tson::Property * tson::WangSet::getProp ( const std::string &  name)
inline

Shortcut for getting a property object. Alternative to getProperties().getProperty("<name>");

Parameters
nameName of the property
Returns

◆ getProperties()

tson::PropertyCollection & tson::WangSet::getProperties ( )
inline

'properties': A list of properties (name, value, type).

Returns

◆ getTile()

int tson::WangSet::getTile ( ) const
inline

'tile': Local ID of tile representing the Wang set

Returns

◆ getWangTiles()

const std::vector< tson::WangTile > & tson::WangSet::getWangTiles ( ) const
inline

'wangtiles': Array of Wang tiles

Returns

◆ parse()

bool tson::WangSet::parse ( IJson json,
tson::Map map 
)
inline

The documentation for this class was generated from the following files: