![]() |
levelz-cpp 0.2.0
|
#include <block.hpp>
Public Member Functions | |
| Block (std::string name) | |
| Block (std::string name, std::unordered_map< std::string, std::string > properties) | |
| std::string | getProperty (std::string key) const |
| std::string | getProperty (std::string key, std::string defaultValue) const |
| bool | hasProperty (std::string key) const |
| bool | operator== (const Block &other) const |
| bool | operator!= (const Block &other) const |
| std::string | to_string () const |
| std::ostream & | operator<< (std::ostream &strm) |
Public Attributes | |
| std::string | name |
| std::unordered_map< std::string, std::string > | properties |
Represents a block in a game level.
|
inlineexplicit |
Constructs a new block with the specified name and empty properties.
|
inline |
Constructs a new block with the specified name and properties.
| name | The name of the block. |
| properties | The properties of the block. |
|
inline |
Gets the property of the block with the specified key.
| key | The key of the property. |
|
inline |
Gets the property of the block with the specified key, or a default value if the property does not exist.
| key | The key of the property. |
| defaultValue | The default value to return if the property does not exist. |
|
inline |
Sets the value of a property.
| key | The key of the property. |
|
inline |
Compares two blocks for inequality.
| other | The other block to compare to. |
|
inline |
Overloads the << operator to allow for easy printing of a Block.
| strm | The output stream to write to. |
|
inline |
Compares two blocks for equality.
| other | The other block to compare to. |
|
inline |
| std::string LevelZ::Block::name |
The name of the block.
| std::unordered_map<std::string, std::string> LevelZ::Block::properties |
The properties of the block.