mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add entity events: on_spawn, on_despawn
This commit is contained in:
parent
e1eb652ef4
commit
eb2be5e8b6
13 changed files with 116 additions and 22 deletions
|
|
@ -6,6 +6,12 @@
|
|||
|
||||
#include "../typedefs.hpp"
|
||||
|
||||
struct entity_funcs_set {
|
||||
bool init : 1;
|
||||
bool on_spawn : 1;
|
||||
bool on_despawn : 1;
|
||||
};
|
||||
|
||||
struct EntityDef {
|
||||
/// @brief Entity string id (with prefix included)
|
||||
std::string const name;
|
||||
|
|
@ -15,6 +21,7 @@ struct EntityDef {
|
|||
|
||||
struct {
|
||||
entityid_t id;
|
||||
entity_funcs_set funcsset;
|
||||
} rt;
|
||||
|
||||
EntityDef(const std::string& name) : name(name) {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue