aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Script.hpp
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.hpp
parent5134bebc19c46e4e07a5ec3af1d3f3d2d17a86dd (diff)
use OptionalRef instead of pointer references
Diffstat (limited to 'src/crepe/api/Script.hpp')
-rw-r--r--src/crepe/api/Script.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/crepe/api/Script.hpp b/src/crepe/api/Script.hpp
index e94278d..a2463bf 100644
--- a/src/crepe/api/Script.hpp
+++ b/src/crepe/api/Script.hpp
@@ -20,9 +20,9 @@ T & Script::get_component() const {
template <typename T>
RefVector<T> Script::get_components() const {
- ComponentManager & mgr = *this->component_manager_ref;
+ ComponentManager & mgr = this->component_manager;
- return mgr.get_components_by_id<T>(*this->game_object_id_ref);
+ return mgr.get_components_by_id<T>(this->game_object_id);
}
template <typename... Args>
@@ -33,10 +33,10 @@ void Script::logf(Args &&... args) {
template <typename EventType>
void Script::subscribe_internal(const EventHandler<EventType> & callback,
event_channel_t channel) {
- EventManager & mgr = *this->event_manager_ref;
+ EventManager & mgr = this->event_manager;
subscription_t listener = mgr.subscribe<EventType>(
[this, callback](const EventType & data) -> bool {
- bool & active = *this->active_ref;
+ bool & active = this->active;
if (!active) return false;
return callback(data);
},