#pragma once #include namespace crepe { class ScriptSystem; } namespace crepe { class BehaviorScript; class Script { friend class crepe::ScriptSystem; protected: virtual void init() {} virtual void update() {} // NOTE: additional *events* (like unity's OnDisable and OnEnable) should be // implemented as member methods in derivative user script classes and // registered in init(), otherwise this class will balloon in size with each // added event. protected: template T & get_component(); template std::vector> get_components(); public: friend class crepe::BehaviorScript; BehaviorScript * parent = nullptr; }; } // namespace crepe #include "Script.hpp"