From 1f82ffa4d3ee8355215d43bf43edf8cecaca0d1d Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 16 Oct 2024 17:21:04 +0200 Subject: fix user script implementation --- src/crepe/api/BehaviorScript.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/crepe/api/BehaviorScript.hpp (limited to 'src/crepe/api/BehaviorScript.hpp') diff --git a/src/crepe/api/BehaviorScript.hpp b/src/crepe/api/BehaviorScript.hpp new file mode 100644 index 0000000..0401c0d --- /dev/null +++ b/src/crepe/api/BehaviorScript.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../util/log.h" +#include "BehaviorScript.h" + +namespace crepe::api { + +template +BehaviorScript & BehaviorScript::set_script() { + static_assert(std::is_base_of::value); + dbg_trace(); + this->script = new T(); + return *this; +} + +} -- cgit v1.2.3