From db66bb4babb19e8a86d5c61281c8b94469729d03 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 21 Nov 2024 10:52:22 +0100 Subject: use OptionalRef instead of pointer references --- src/crepe/api/Script.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/crepe/api/Script.h') diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h index 43efd15..6418b04 100644 --- a/src/crepe/api/Script.h +++ b/src/crepe/api/Script.h @@ -2,6 +2,7 @@ #include +#include "../util/OptionalRef.h" #include "../types.h" #include "EventManager.h" @@ -150,18 +151,16 @@ private: * implement a non-default constructor (e.g. for passing references to their own concrete * Script classes). * - * \todo These should be converted to OptionalRef<> once `loek/util` is merged - * * \{ */ //! Game object ID of game object parent BehaviorScript is attached to - const game_object_id_t * game_object_id_ref = nullptr; + OptionalRef game_object_id; //! Reference to parent component - bool * active_ref = nullptr; + OptionalRef active; //! Reference to component manager instance - ComponentManager * component_manager_ref = nullptr; + OptionalRef component_manager; //! Reference to event manager instance - EventManager * event_manager_ref = nullptr; + OptionalRef event_manager; //! \} private: -- cgit v1.2.3