aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Script.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-21 10:52:22 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-21 10:52:22 +0100
commitdb66bb4babb19e8a86d5c61281c8b94469729d03 (patch)
tree83c25f47797c7bd8e06d15412a9859599788569a /src/crepe/api/Script.h
parent5134bebc19c46e4e07a5ec3af1d3f3d2d17a86dd (diff)
use OptionalRef instead of pointer references
Diffstat (limited to 'src/crepe/api/Script.h')
-rw-r--r--src/crepe/api/Script.h11
1 files changed, 5 insertions, 6 deletions
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 <vector>
+#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<const game_object_id_t> game_object_id;
//! Reference to parent component
- bool * active_ref = nullptr;
+ OptionalRef<bool> active;
//! Reference to component manager instance
- ComponentManager * component_manager_ref = nullptr;
+ OptionalRef<ComponentManager> component_manager;
//! Reference to event manager instance
- EventManager * event_manager_ref = nullptr;
+ OptionalRef<EventManager> event_manager;
//! \}
private: