![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Encapsulates a set of layers for a given map height. Maps have one LayerSet per height level, as well as a TransitionLayer. More...
#include <LayerSet.hpp>
Public Member Functions | |
LayerSet ()=default | |
Builds a new empty layer set. More... | |
void | init (unsigned int width, unsigned int height, unsigned int bottomLayerCount, unsigned int ysortLayerCount, unsigned int topLayercount) |
Creates the given number of layers and sets the proper size for each layer, initializing each layer tile to empty. More... | |
CollisionLayer & | collisionLayer () |
Returns a reference to the collision layer for this set. More... | |
const CollisionLayer & | collisionLayer () const |
Returns a reference to the collision layer for this set. More... | |
CatchLayer & | catchLayer () |
Returns a reference to the catchable layer for this set. More... | |
const CatchLayer & | catchLayer () const |
Returns a reference to the catchable layer for this set. More... | |
std::vector< TileLayer > & | bottomLayers () |
Returns a reference to the bottom tiles in this set. More... | |
std::vector< TileLayer > & | ysortLayers () |
Returns a reference to the sorted tiles in this set. More... | |
std::vector< TileLayer > & | topLayers () |
Returns a reference to the top tiles in this set. More... | |
const std::vector< TileLayer > & | bottomLayers () const |
Returns a reference to the bottom tiles in this set. More... | |
const std::vector< TileLayer > & | ysortLayers () const |
Returns a reference to the sorted tiles in this set. More... | |
const std::vector< TileLayer > & | topLayers () const |
Returns a reference to the top tiles in this set. More... | |
unsigned int | layerCount () const |
Returns the total number of layers contained. More... | |
TileLayer & | getLayer (unsigned int layer) |
Returns a reference to the given tile layer. Helper to use absolute indices to access all layer zones. More... | |
Friends | |
struct | bl::serial::SerializableObject< LayerSet > |
Encapsulates a set of layers for a given map height. Maps have one LayerSet per height level, as well as a TransitionLayer.
Definition at line 51 of file LayerSet.hpp.
|
default |
Builds a new empty layer set.
std::vector< TileLayer > & core::map::LayerSet::bottomLayers | ( | ) |
Returns a reference to the bottom tiles in this set.
Definition at line 33 of file LayerSet.cpp.
const std::vector< TileLayer > & core::map::LayerSet::bottomLayers | ( | ) | const |
Returns a reference to the bottom tiles in this set.
Definition at line 41 of file LayerSet.cpp.
CatchLayer & core::map::LayerSet::catchLayer | ( | ) |
Returns a reference to the catchable layer for this set.
Definition at line 29 of file LayerSet.cpp.
const CatchLayer & core::map::LayerSet::catchLayer | ( | ) | const |
Returns a reference to the catchable layer for this set.
Definition at line 31 of file LayerSet.cpp.
CollisionLayer & core::map::LayerSet::collisionLayer | ( | ) |
Returns a reference to the collision layer for this set.
Definition at line 25 of file LayerSet.cpp.
const CollisionLayer & core::map::LayerSet::collisionLayer | ( | ) | const |
Returns a reference to the collision layer for this set.
Definition at line 27 of file LayerSet.cpp.
TileLayer & core::map::LayerSet::getLayer | ( | unsigned int | layer | ) |
Returns a reference to the given tile layer. Helper to use absolute indices to access all layer zones.
layer | The layer index to fetch |
Definition at line 47 of file LayerSet.cpp.
void core::map::LayerSet::init | ( | unsigned int | width, |
unsigned int | height, | ||
unsigned int | bottomLayerCount, | ||
unsigned int | ysortLayerCount, | ||
unsigned int | topLayercount | ||
) |
Creates the given number of layers and sets the proper size for each layer, initializing each layer tile to empty.
width | The width of the map, in tiles |
height | The height of the map, in tiles |
bottomLayerCount | The number of layers rendered under entities |
ysortLayerCount | The number of layers rendered with entities |
topLayercount | The number of layers renered over entities |
Definition at line 10 of file LayerSet.cpp.
unsigned int core::map::LayerSet::layerCount | ( | ) | const |
Returns the total number of layers contained.
Definition at line 39 of file LayerSet.cpp.
std::vector< TileLayer > & core::map::LayerSet::topLayers | ( | ) |
Returns a reference to the top tiles in this set.
Definition at line 37 of file LayerSet.cpp.
const std::vector< TileLayer > & core::map::LayerSet::topLayers | ( | ) | const |
Returns a reference to the top tiles in this set.
Definition at line 45 of file LayerSet.cpp.
std::vector< TileLayer > & core::map::LayerSet::ysortLayers | ( | ) |
Returns a reference to the sorted tiles in this set.
Definition at line 35 of file LayerSet.cpp.
const std::vector< TileLayer > & core::map::LayerSet::ysortLayers | ( | ) | const |
Returns a reference to the sorted tiles in this set.
Definition at line 43 of file LayerSet.cpp.
|
friend |
Definition at line 162 of file LayerSet.hpp.