aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Script.hpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-22 12:32:22 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-22 12:32:22 +0100
commit61148c757a1f742ff09e40e5347e74e638c7371c (patch)
treea2e40998981fa6f12430d2a1254250219f30d44f /src/crepe/api/Script.hpp
parente2162171c7ab72f450f73a0908946aa4a4dee5ee (diff)
update clang-format options
Diffstat (limited to 'src/crepe/api/Script.hpp')
-rw-r--r--src/crepe/api/Script.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/crepe/api/Script.hpp b/src/crepe/api/Script.hpp
index 4462a41..c7fa6ff 100644
--- a/src/crepe/api/Script.hpp
+++ b/src/crepe/api/Script.hpp
@@ -14,7 +14,8 @@ T & Script::get_component() const {
RefVector<T> all_components = this->get_components<T>();
if (all_components.size() < 1)
throw runtime_error(
- format("Script: no component found with type = {}", typeid(T).name()));
+ format("Script: no component found with type = {}", typeid(T).name())
+ );
return all_components.back().get();
}
@@ -35,8 +36,9 @@ void Script::logf(std::format_string<Args...> fmt, Args &&... args) {
}
template <typename EventType>
-void Script::subscribe_internal(const EventHandler<EventType> & callback,
- event_channel_t channel) {
+void Script::subscribe_internal(
+ const EventHandler<EventType> & callback, event_channel_t channel
+) {
EventManager & mgr = this->mediator->event_manager;
subscription_t listener = mgr.subscribe<EventType>(
[this, callback](const EventType & data) -> bool {
@@ -54,7 +56,8 @@ void Script::subscribe_internal(const EventHandler<EventType> & callback,
// call user-provided callback
return callback(data);
},
- channel);
+ channel
+ );
this->listeners.push_back(listener);
}