mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
update entity script semantics
This commit is contained in:
parent
c54be7b2b1
commit
fc3994446a
11 changed files with 193 additions and 69 deletions
|
|
@ -9,6 +9,12 @@
|
|||
#include <unordered_map>
|
||||
#include <entt/entity/registry.hpp>
|
||||
|
||||
struct entity_funcs_set {
|
||||
bool init : 1;
|
||||
bool on_despawn : 1;
|
||||
bool on_grounded : 1;
|
||||
};
|
||||
|
||||
struct EntityDef;
|
||||
|
||||
struct EntityId {
|
||||
|
|
@ -30,6 +36,11 @@ struct Rigidbody {
|
|||
Hitbox hitbox;
|
||||
};
|
||||
|
||||
struct Scripting {
|
||||
entity_funcs_set funcsset;
|
||||
scriptenv env;
|
||||
};
|
||||
|
||||
class Level;
|
||||
class Assets;
|
||||
class LineBatch;
|
||||
|
|
@ -67,6 +78,10 @@ public:
|
|||
return registry.get<Rigidbody>(entity);
|
||||
}
|
||||
|
||||
Scripting& getScripting() const {
|
||||
return registry.get<Scripting>(entity);
|
||||
}
|
||||
|
||||
entityid_t getUID() const {
|
||||
return registry.get<EntityId>(entity).uid;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue