From b3b762a34e7ccb4a0dcd041a693ac7180af16002 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 25 Oct 2024 20:47:19 +0200 Subject: `make format` --- src/crepe/api/Script.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/crepe/api/Script.hpp') diff --git a/src/crepe/api/Script.hpp b/src/crepe/api/Script.hpp index 8ddd344..8004fe3 100644 --- a/src/crepe/api/Script.hpp +++ b/src/crepe/api/Script.hpp @@ -2,25 +2,24 @@ #include "../ComponentManager.h" -#include "Script.h" #include "BehaviorScript.h" +#include "Script.h" namespace crepe::api { -template +template T & Script::get_component() { - std::vector> all_components = this->get_components(); - if (all_components.size() < 1) - throw nullptr; // TODO - + std::vector> all_components + = this->get_components(); + if (all_components.size() < 1) throw nullptr; // TODO + return all_components.back().get(); } -template +template std::vector> Script::get_components() { ComponentManager & mgr = ComponentManager::get_instance(); return mgr.get_components_by_id(this->parent->game_object_id); } -} - +} // namespace crepe::api -- cgit v1.2.3