![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Primary system for managing the player and their data. More...
#include <Player.hpp>
Public Member Functions | |
Player (Systems &owner) | |
Construct a new Player system. More... | |
virtual | ~Player ()=default |
Destroys the system. More... | |
bool | spawnPlayer (const bl::tmap::Position &position, map::Map &map) |
Spawns the player into the world. More... | |
bool | makePlayerControlled (bl::ecs::Entity entity) |
Makes the given entity controlled by the player. Only one entity may be player controlled at a time. More... | |
void | removePlayerControlled (bl::ecs::Entity entity) |
Removes the PlayerControlled component from the given entity, if any. More... | |
bl::ecs::Entity | player () const |
Returns the id of the player entity. More... | |
const bl::tmap::Position & | position () const |
Returns the current position of the player. More... | |
void | newGame (const std::string &name, player::Gender gender) |
Initializes all player data structures for a new game. More... | |
void | whiteout () |
Heals all Peoplemon and respawns at the last PC center. More... | |
player::State & | state () |
Returns the state of the player. More... | |
const player::State & | state () const |
Returns the state of the player. More... | |
void | showLantern () |
Creates a light for the player's lantern. Keeps it updated as well. More... | |
Friends | |
struct | bl::serial::SerializableObject< Player > |
Primary system for managing the player and their data.
Definition at line 33 of file Player.hpp.
core::system::Player::Player | ( | Systems & | owner | ) |
Construct a new Player system.
owner | The primary systems object |
Definition at line 29 of file Player.cpp.
|
virtualdefault |
Destroys the system.
bool core::system::Player::makePlayerControlled | ( | bl::ecs::Entity | entity | ) |
Makes the given entity controlled by the player. Only one entity may be player controlled at a time.
entity | The entity to receive player input |
Definition at line 76 of file Player.cpp.
void core::system::Player::newGame | ( | const std::string & | name, |
player::Gender | gender | ||
) |
Initializes all player data structures for a new game.
name | The name of the player |
gender | The gender of the player |
Definition at line 59 of file Player.cpp.
bl::ecs::Entity core::system::Player::player | ( | ) | const |
Returns the id of the player entity.
Definition at line 55 of file Player.cpp.
const bl::tmap::Position & core::system::Player::position | ( | ) | const |
Returns the current position of the player.
Definition at line 57 of file Player.cpp.
void core::system::Player::removePlayerControlled | ( | bl::ecs::Entity | entity | ) |
Removes the PlayerControlled component from the given entity, if any.
entity | The entity to remove player control from |
Definition at line 91 of file Player.cpp.
void core::system::Player::showLantern | ( | ) |
Creates a light for the player's lantern. Keeps it updated as well.
Definition at line 106 of file Player.cpp.
bool core::system::Player::spawnPlayer | ( | const bl::tmap::Position & | position, |
map::Map & | map | ||
) |
Spawns the player into the world.
position | The position to spawn at |
map | The map to spawn in |
Definition at line 32 of file Player.cpp.
player::State & core::system::Player::state | ( | ) |
Returns the state of the player.
Definition at line 154 of file Player.cpp.
const player::State & core::system::Player::state | ( | ) | const |
Returns the state of the player.
Definition at line 156 of file Player.cpp.
void core::system::Player::whiteout | ( | ) |
Heals all Peoplemon and respawns at the last PC center.
Definition at line 97 of file Player.cpp.
|
friend |
Definition at line 142 of file Player.hpp.
float core::system::Player::varianceConvergeRate |
Definition at line 128 of file Player.hpp.
float core::system::Player::varianceSwitchTime |
Definition at line 129 of file Player.hpp.