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

Public Member Functions

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

Private Member Functions

bool parseTiled15Props (IJson &json)
 

Private Attributes

std::shared_ptr< tson::TiledClassm_class {}
 
std::string m_classType {}
 
std::vector< tson::WangColorm_colors
 
std::vector< tson::WangColorm_cornerColors
 
std::vector< tson::WangColorm_edgeColors
 
tson::Mapm_map
 
std::string m_name
 
tson::PropertyCollection m_properties
 
int m_tile {}
 
std::vector< tson::WangTilem_wangTiles
 

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.

◆ 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

◆ parseTiled15Props()

bool tson::WangSet::parseTiled15Props ( tson::IJson json)
inlineprivate

Declared in tileson_forward.hpp

Parsing data related to Tiled v1.5 changes

Parameters
jsonThe json containing data
Returns
Returns true if success

Field Documentation

◆ m_class

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

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

◆ m_colors

std::vector<tson::WangColor> tson::WangSet::m_colors
private

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

◆ m_cornerColors

std::vector<tson::WangColor> tson::WangSet::m_cornerColors
private

'wangtiles': Array of Wang tiles

◆ m_edgeColors

std::vector<tson::WangColor> tson::WangSet::m_edgeColors
private

'cornercolors': Array of Wang colors

◆ m_map

tson::Map* tson::WangSet::m_map
private

'colors':

◆ m_properties

tson::PropertyCollection tson::WangSet::m_properties
private

'edgecolors': Array of Wang colors

◆ m_tile

int tson::WangSet::m_tile {}
private

'name': Name of the Wang set

◆ m_wangTiles

std::vector<tson::WangTile> tson::WangSet::m_wangTiles
private

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


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