Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/interfaces/StarScriptedEntity.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /source/game/interfaces/StarScriptedEntity.hpp
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'source/game/interfaces/StarScriptedEntity.hpp')
-rw-r--r--source/game/interfaces/StarScriptedEntity.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/game/interfaces/StarScriptedEntity.hpp b/source/game/interfaces/StarScriptedEntity.hpp
new file mode 100644
index 0000000..40aa552
--- /dev/null
+++ b/source/game/interfaces/StarScriptedEntity.hpp
@@ -0,0 +1,25 @@
+#ifndef STAR_SCRIPTED_ENTITY_HPP
+#define STAR_SCRIPTED_ENTITY_HPP
+
+#include "StarEntity.hpp"
+#include "StarLua.hpp"
+
+namespace Star {
+
+STAR_CLASS(ScriptedEntity);
+
+// All ScriptedEntity methods should only be called on master entities
+class ScriptedEntity : public virtual Entity {
+public:
+ // Call a script function directly with the given arguments, should return
+ // nothing only on failure.
+ virtual Maybe<LuaValue> callScript(String const& func, LuaVariadic<LuaValue> const& args) = 0;
+
+ // Execute the given code directly in the underlying context, return nothing
+ // on failure.
+ virtual Maybe<LuaValue> evalScript(String const& code) = 0;
+};
+
+}
+
+#endif