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

Public Member Functions

 Terrain (IJson &json)
 
 Terrain (std::string name, int tile)
 
template<typename T >
get (const std::string &name)
 
const std::string & getName () const
 
tson::PropertygetProp (const std::string &name)
 
PropertyCollectiongetProperties ()
 
int getTile () const
 
bool parse (IJson &json)
 

Private Attributes

std::string m_name
 
tson::PropertyCollection m_properties
 
int m_tile {}
 

Member Function Documentation

◆ get()

template<typename T >
T tson::Terrain::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.

◆ getName()

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

'name': Name of terrain

Returns

◆ getProp()

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

'properties': A list of properties (name, value, type). Missing from the official Tiled documentation...

Returns

◆ getTile()

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

'tile': Local ID of tile representing terrain

Returns

Field Documentation

◆ m_properties

tson::PropertyCollection tson::Terrain::m_properties
private

'tile': Local ID of tile representing terrain

◆ m_tile

int tson::Terrain::m_tile {}
private

'name': Name of terrain


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