Uranus  1.0.1.0
Uranus is a GameEngine written in C++
Loading...
Searching...
No Matches
tson::WangColor Class Reference
Collaboration diagram for tson::WangColor:
[legend]

Public Member Functions

 WangColor (IJson &json, tson::Map *map)
 
template<typename T >
get (const std::string &name)
 
tson::TiledClassgetClass ()
 
const std::string & getClassType () const
 
const ColorigetColor () const
 
const std::string & getName () const
 
float getProbability () const
 
tson::PropertygetProp (const std::string &name)
 
PropertyCollectiongetProperties ()
 
int getTile () const
 
bool parse (IJson &json, tson::Map *map)
 

Private Attributes

std::shared_ptr< tson::TiledClassm_class {}
 
std::string m_classType {}
 
tson::Colori m_color
 
tson::Mapm_map
 
std::string m_name
 
float m_probability {}
 
tson::PropertyCollection m_properties
 
int m_tile {}
 

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.

◆ 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

Field Documentation

◆ m_class

std::shared_ptr<tson::TiledClass> tson::WangColor::m_class {}
private

'class': The class of this map (since 1.9, defaults to “”).

◆ m_color

tson::Colori tson::WangColor::m_color
private

Declared in tileson_forward.hpp

◆ m_map

tson::Map* tson::WangColor::m_map
private

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

◆ m_name

std::string tson::WangColor::m_name
private

'color': Hex-formatted color (#RRGGBB or #AARRGGBB)

◆ m_probability

float tson::WangColor::m_probability {}
private

'name': Name of the Wang color

◆ m_properties

tson::PropertyCollection tson::WangColor::m_properties
private

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

◆ m_tile

int tson::WangColor::m_tile {}
private

'probability': Probability used when randomizing


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