Peoplemon  0.1.0
Peoplemon 3 game source documentation
Entity.hpp
Go to the documentation of this file.
1 #ifndef CORE_SYSTEMS_ENTITY_HPP
2 #define CORE_SYSTEMS_ENTITY_HPP
3 
4 #include <BLIB/ECS.hpp>
5 #include <BLIB/Render/Scenes/Scene.hpp>
7 #include <Core/Maps/Item.hpp>
8 
9 namespace core
10 {
11 namespace map
12 {
13 class Map;
14 }
15 
16 namespace system
17 {
18 class Systems;
19 
27 class Entity {
28 public:
34  Entity(Systems& owner);
35 
43  bl::ecs::Entity spawnCharacter(const map::CharacterSpawn& spawn, map::Map& map);
44 
52  bool spawnItem(const map::Item& item, map::Map& map);
53 
64  bl::ecs::Entity spawnGeneric(std::uint8_t level, const glm::i32vec2& tiles, bool collidable,
65  const std::string& gfx, map::Map& map);
66 
77  bl::ecs::Entity spawnAnimation(std::uint8_t level, const glm::vec2& position,
78  const std::string& gfx, map::Map& map);
79 
80 private:
81  Systems& owner;
82 };
83 
84 } // namespace system
85 } // namespace core
86 
87 #endif
Core classes and functionality for both the editor and game.
Represents a character to be spawned into a map on load.
Basic struct representing a pickup-able item in Map.
Definition: Item.hpp:16
The primary map class that represents a usable map in the game.
Definition: Map.hpp:49
Basic helper system for creating entities and their required components. Also manages player data and...
Definition: Entity.hpp:27
Entity(Systems &owner)
Construct a new Entity system.
Definition: Entity.cpp:22
bool spawnItem(const map::Item &item, map::Map &map)
Spawns an item into the world.
Definition: Entity.cpp:98
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 tri...
Definition: Entity.cpp:155
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.
Definition: Entity.cpp:127
bl::ecs::Entity spawnCharacter(const map::CharacterSpawn &spawn, map::Map &map)
Spawns a trainer or an npc from the given spawn information.
Definition: Entity.cpp:25
Owns all primary systems and a reference to the engine.
Definition: Systems.hpp:47