aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Script.hpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-07 16:01:19 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-07 16:01:19 +0100
commit2e6fcb1d048edd13a2ec69ddd226fc8ebabc2389 (patch)
tree249b4633d24339467de9d0d008dce602a9cbd2cc /src/crepe/api/Script.hpp
parentf19f37ae3eff84161f86e62a26fbd8b68f8f91a9 (diff)
add SaveManager to Script
Diffstat (limited to 'src/crepe/api/Script.hpp')
-rw-r--r--src/crepe/api/Script.hpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/crepe/api/Script.hpp b/src/crepe/api/Script.hpp
index 45f1ff1..23d69d9 100644
--- a/src/crepe/api/Script.hpp
+++ b/src/crepe/api/Script.hpp
@@ -20,8 +20,7 @@ T & Script::get_component() const {
template <typename T>
RefVector<T> Script::get_components() const {
- Mediator & mediator = this->mediator;
- ComponentManager & mgr = mediator.component_manager;
+ ComponentManager & mgr = this->mediator->component_manager;
return mgr.get_components_by_id<T>(this->game_object_id);
}
@@ -34,8 +33,7 @@ void Script::logf(Args &&... args) {
template <typename EventType>
void Script::subscribe_internal(const EventHandler<EventType> & callback,
event_channel_t channel) {
- Mediator & mediator = this->mediator;
- EventManager & mgr = mediator.event_manager;
+ EventManager & mgr = this->mediator->event_manager;
subscription_t listener = mgr.subscribe<EventType>(
[this, callback](const EventType & data) -> bool {
bool & active = this->active;