![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Basic helper system for creating entities and their required components. Also manages player data and entity id. More...
#include <Entity.hpp>
Public Member Functions | |
Entity (Systems &owner) | |
Construct a new Entity system. More... | |
bl::ecs::Entity | spawnCharacter (const map::CharacterSpawn &spawn, map::Map &map) |
Spawns a trainer or an npc from the given spawn information. More... | |
bool | spawnItem (const map::Item &item, map::Map &map) |
Spawns an item into the world. More... | |
bl::ecs::Entity | spawnGeneric (std::uint8_t level, const glm::i32vec2 &tiles, bool collidable, const std::string &gfx, map::Map &map) |
Spawns a generic entity with some basic components. More... | |
bl::ecs::Entity | spawnAnimation (std::uint8_t level, const glm::vec2 &position, const std::string &gfx, map::Map &map) |
Spawns an animation-only entity at the given position. The animation is not played until manually triggered. More... | |
Basic helper system for creating entities and their required components. Also manages player data and entity id.
Definition at line 27 of file Entity.hpp.
core::system::Entity::Entity | ( | Systems & | owner | ) |
Construct a new Entity system.
owner | The primary systems object |
Definition at line 22 of file Entity.cpp.
bl::ecs::Entity core::system::Entity::spawnAnimation | ( | std::uint8_t | level, |
const glm::vec2 & | position, | ||
const std::string & | gfx, | ||
map::Map & | map | ||
) |
Spawns an animation-only entity at the given position. The animation is not played until manually triggered.
level | The map level to spawn on |
position | The position to spawn the entity at |
gfx | The path to the animation to render |
map | The map to spawn in |
Definition at line 155 of file Entity.cpp.
bl::ecs::Entity core::system::Entity::spawnCharacter | ( | const map::CharacterSpawn & | spawn, |
map::Map & | map | ||
) |
Spawns a trainer or an npc from the given spawn information.
spawn | The map spawn information |
map | The map to spawn in |
NPC
More common components
Definition at line 25 of file Entity.cpp.
bl::ecs::Entity core::system::Entity::spawnGeneric | ( | std::uint8_t | level, |
const glm::i32vec2 & | tiles, | ||
bool | collidable, | ||
const std::string & | gfx, | ||
map::Map & | map | ||
) |
Spawns a generic entity with some basic components.
level | The map level to spawn on |
tiles | The position to spawn at |
collidable | True to add a collidable component, false to not |
gfx | Path to image or animation for graphic component |
map | The map to spawn in |
Definition at line 127 of file Entity.cpp.
Spawns an item into the world.
item | The item information to spawn |
map | The map to spawn in |
Definition at line 98 of file Entity.cpp.