update entity script semantics
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user