summary refs log tree commit diff stats
path: root/src/systems
diff options
context:
space:
mode:
Diffstat (limited to 'src/systems')
-rw-r--r--src/systems/automating.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/systems/automating.cpp b/src/systems/automating.cpp index 5233e3e..4a5357d 100644 --- a/src/systems/automating.cpp +++ b/src/systems/automating.cpp
@@ -3,6 +3,7 @@
3#include "components/automatable.h" 3#include "components/automatable.h"
4#include "components/ponderable.h" 4#include "components/ponderable.h"
5#include "components/realizable.h" 5#include "components/realizable.h"
6#include "components/transformable.h"
6#include "systems/realizing.h" 7#include "systems/realizing.h"
7#include "vector.h" 8#include "vector.h"
8 9
@@ -83,12 +84,21 @@ void AutomatingSystem::initScriptEngine(sol::state& scriptEngine)
83 "entity", 84 "entity",
84 sol::constructors<script_entity(id_type)>(), 85 sol::constructors<script_entity(id_type)>(),
85 "id", &script_entity::id, 86 "id", &script_entity::id,
87 "transformable",
88 [&] (script_entity& entity) -> TransformableComponent& {
89 return game_.getEntityManager().
90 getComponent<TransformableComponent>(entity.id);
91 },
86 "ponderable", 92 "ponderable",
87 [&] (script_entity& entity) -> PonderableComponent& { 93 [&] (script_entity& entity) -> PonderableComponent& {
88 return game_.getEntityManager(). 94 return game_.getEntityManager().
89 getComponent<PonderableComponent>(entity.id); 95 getComponent<PonderableComponent>(entity.id);
90 }); 96 });
91 97
98 scriptEngine.new_usertype<TransformableComponent>(
99 "transformable",
100 "pos", &TransformableComponent::pos);
101
92 scriptEngine.new_usertype<PonderableComponent>( 102 scriptEngine.new_usertype<PonderableComponent>(
93 "ponderable", 103 "ponderable",
94 "vel", &PonderableComponent::vel, 104 "vel", &PonderableComponent::vel,