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

#include <WangColor.hpp>

Public Member Functions

 WangColor ()=default
 
 WangColor (IJson &json, tson::Map *map)
 
bool parse (IJson &json, tson::Map *map)
 
const ColorigetColor () const
 
const std::string & getName () const
 
float getProbability () const
 
int getTile () 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

◆ WangColor() [1/2]

tson::WangColor::WangColor ( )
inlinedefault

◆ WangColor() [2/2]

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

Member Function Documentation

◆ get()

template<typename T >
T tson::WangColor::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::WangColor::getClass ( )
inline

◆ getClassType()

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

◆ getColor()

const tson::Colori & tson::WangColor::getColor ( ) const
inline

'color': Color object created from hex-formatted string (#RRGGBB or #AARRGGBB)

Returns

◆ getName()

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

'name': Name of the Wang color

Returns

◆ getProbability()

float tson::WangColor::getProbability ( ) const
inline

'probability': Probability used when randomizing

Returns

◆ getProp()

tson::Property * tson::WangColor::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::WangColor::getProperties ( )
inline

New property in Tiled v1.5 when data is contained in 'colors' of a wangset 'properties': A list of properties (name, value, type).

Returns

◆ getTile()

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

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

Returns

◆ parse()

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

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