Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Member Functions | Friends | List of all members
core::map::LayerSet Class Reference

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...
 
CollisionLayercollisionLayer ()
 Returns a reference to the collision layer for this set. More...
 
const CollisionLayercollisionLayer () const
 Returns a reference to the collision layer for this set. More...
 
CatchLayercatchLayer ()
 Returns a reference to the catchable layer for this set. More...
 
const CatchLayercatchLayer () 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...
 
TileLayergetLayer (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 >
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LayerSet()

core::map::LayerSet::LayerSet ( )
default

Builds a new empty layer set.

Member Function Documentation

◆ bottomLayers() [1/2]

std::vector< TileLayer > & core::map::LayerSet::bottomLayers ( )

Returns a reference to the bottom tiles in this set.

Returns
std::vector<TileLayer>& The tiles rendered underneath all entities

Definition at line 33 of file LayerSet.cpp.

◆ bottomLayers() [2/2]

const std::vector< TileLayer > & core::map::LayerSet::bottomLayers ( ) const

Returns a reference to the bottom tiles in this set.

Returns
std::vector<TileLayer>& The tiles rendered underneath all entities

Definition at line 41 of file LayerSet.cpp.

◆ catchLayer() [1/2]

CatchLayer & core::map::LayerSet::catchLayer ( )

Returns a reference to the catchable layer for this set.

Returns
CatchLayer& The catch tiles at this height

Definition at line 29 of file LayerSet.cpp.

◆ catchLayer() [2/2]

const CatchLayer & core::map::LayerSet::catchLayer ( ) const

Returns a reference to the catchable layer for this set.

Returns
CatchLayer& The catch tiles at this height

Definition at line 31 of file LayerSet.cpp.

◆ collisionLayer() [1/2]

CollisionLayer & core::map::LayerSet::collisionLayer ( )

Returns a reference to the collision layer for this set.

Returns
CollisionLayer& The collisions at this height

Definition at line 25 of file LayerSet.cpp.

◆ collisionLayer() [2/2]

const CollisionLayer & core::map::LayerSet::collisionLayer ( ) const

Returns a reference to the collision layer for this set.

Returns
CollisionLayer& The collisions at this height

Definition at line 27 of file LayerSet.cpp.

◆ getLayer()

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.

Parameters
layerThe layer index to fetch
Returns
A reference to the layer at the given index

Definition at line 47 of file LayerSet.cpp.

◆ init()

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.

Parameters
widthThe width of the map, in tiles
heightThe height of the map, in tiles
bottomLayerCountThe number of layers rendered under entities
ysortLayerCountThe number of layers rendered with entities
topLayercountThe number of layers renered over entities

Definition at line 10 of file LayerSet.cpp.

◆ layerCount()

unsigned int core::map::LayerSet::layerCount ( ) const

Returns the total number of layers contained.

Definition at line 39 of file LayerSet.cpp.

◆ topLayers() [1/2]

std::vector< TileLayer > & core::map::LayerSet::topLayers ( )

Returns a reference to the top tiles in this set.

Returns
std::vector<TileLayer>& The

Definition at line 37 of file LayerSet.cpp.

◆ topLayers() [2/2]

const std::vector< TileLayer > & core::map::LayerSet::topLayers ( ) const

Returns a reference to the top tiles in this set.

Returns
std::vector<TileLayer>& The

Definition at line 45 of file LayerSet.cpp.

◆ ysortLayers() [1/2]

std::vector< TileLayer > & core::map::LayerSet::ysortLayers ( )

Returns a reference to the sorted tiles in this set.

Returns
std::vector<TileLayer>& The tiles rendered inline with entities based on y coordinate

Definition at line 35 of file LayerSet.cpp.

◆ ysortLayers() [2/2]

const std::vector< TileLayer > & core::map::LayerSet::ysortLayers ( ) const

Returns a reference to the sorted tiles in this set.

Returns
std::vector<TileLayer>& The tiles rendered inline with entities based on y coordinate

Definition at line 43 of file LayerSet.cpp.

Friends And Related Function Documentation

◆ bl::serial::SerializableObject< LayerSet >

friend struct bl::serial::SerializableObject< LayerSet >
friend

Definition at line 162 of file LayerSet.hpp.


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