![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
The primary entity positioning system. Handles determining which entities get updated as well as tracking where entities are for collisions. More...
#include <Position.hpp>
Public Member Functions | |
Position (Systems &owner) | |
Construct the Position system. More... | |
virtual | ~Position ()=default |
Destroy the Position system. More... | |
bl::ecs::Entity | getEntity (const bl::tmap::Position &pos) const |
Returns the entity at the given position or InvalidEntity if not found. More... | |
bool | spaceFree (const bl::tmap::Position &position) const |
Returns whether or not a tile is currently occupied. More... | |
bl::ecs::Entity | search (const bl::tmap::Position &start, bl::tmap::Direction dir, unsigned int range) |
Searches for an entity from the starting position in the given direction for the given number of spaces. Note that start position should be the position of a searching entity and is not included in the search results. More... | |
void | editorPushLevel () |
Called by the editor when a level is added. More... | |
void | editorPopLevel () |
Called by the editor when a level is removed. More... | |
The primary entity positioning system. Handles determining which entities get updated as well as tracking where entities are for collisions.
Definition at line 26 of file Position.hpp.
core::system::Position::Position | ( | Systems & | owner | ) |
Construct the Position system.
owner | The primary Systems object |
Definition at line 13 of file Position.cpp.
|
virtualdefault |
Destroy the Position system.
void core::system::Position::editorPopLevel | ( | ) |
Called by the editor when a level is removed.
Definition at line 116 of file Position.cpp.
void core::system::Position::editorPushLevel | ( | ) |
Called by the editor when a level is added.
Definition at line 111 of file Position.cpp.
bl::ecs::Entity core::system::Position::getEntity | ( | const bl::tmap::Position & | pos | ) | const |
Returns the entity at the given position or InvalidEntity if not found.
pos | The position to check |
Definition at line 96 of file Position.cpp.
bl::ecs::Entity core::system::Position::search | ( | const bl::tmap::Position & | start, |
bl::tmap::Direction | dir, | ||
unsigned int | range | ||
) |
Searches for an entity from the starting position in the given direction for the given number of spaces. Note that start position should be the position of a searching entity and is not included in the search results.
start | The position to start at. Is not searched |
range | Number of spaces to search. Must be greater than 1 |
Definition at line 39 of file Position.cpp.
bool core::system::Position::spaceFree | ( | const bl::tmap::Position & | position | ) | const |
Returns whether or not a tile is currently occupied.
position | The tile position to check |
Definition at line 28 of file Position.cpp.