From 128e7975eb6417438fcf6f51224b6067554a2004 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Fri, 13 Dec 2024 18:43:12 +0100 Subject: added feedback --- src/crepe/api/Scene.cpp | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/crepe/api/Scene.cpp (limited to 'src/crepe/api/Scene.cpp') diff --git a/src/crepe/api/Scene.cpp b/src/crepe/api/Scene.cpp new file mode 100644 index 0000000..5117766 --- /dev/null +++ b/src/crepe/api/Scene.cpp @@ -0,0 +1,5 @@ +#include "Scene.h" + +using namespace crepe; + +SaveManager & Scene::get_save_manager() const { return mediator->save_manager; } -- cgit v1.2.3 From c4c5758061c817784743af07271445905d62dfdd Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Fri, 13 Dec 2024 20:47:57 +0100 Subject: moved code to cpp --- src/crepe/api/Scene.cpp | 10 ++++++++++ src/crepe/api/Scene.h | 19 ++++--------------- 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src/crepe/api/Scene.cpp') diff --git a/src/crepe/api/Scene.cpp b/src/crepe/api/Scene.cpp index 5117766..9a2a1bc 100644 --- a/src/crepe/api/Scene.cpp +++ b/src/crepe/api/Scene.cpp @@ -3,3 +3,13 @@ using namespace crepe; SaveManager & Scene::get_save_manager() const { return mediator->save_manager; } + +GameObject Scene::new_object(const std::string & name, const std::string & tag, const vec2 & position, double rotation, double scale) { + // Forward the call to ComponentManager's new_object method + return mediator->component_manager->new_object(name, tag, position, rotation, scale); +} + + +void Scene::set_persistent(const Asset & asset, bool persistent) { + mediator->resource_manager->set_persistent(asset, persistent); +} diff --git a/src/crepe/api/Scene.h b/src/crepe/api/Scene.h index cba4e10..e70d9ba 100644 --- a/src/crepe/api/Scene.h +++ b/src/crepe/api/Scene.h @@ -68,23 +68,12 @@ protected: */ SaveManager & get_save_manager() const; - /** - * \copydoc ComponentManager::new_object - */ - GameObject new_object(const std::string & name, const std::string & tag = "", - const vec2 & position = {0, 0}, double rotation = 0, - double scale = 1) { - // Forward the call to ComponentManager's new_object method - return mediator->component_manager->new_object(name, tag, position, rotation, scale); - } + //! \copydoc ComponentManager::new_object + GameObject new_object(const std::string & name, const std::string & tag = "", const vec2 & position = {0, 0}, double rotation = 0, double scale = 1); - /** - * \copydoc ResourceManager::set_persistent - */ - void set_persistent(const Asset & asset, bool persistent) { - mediator->resource_manager->set_persistent(asset, persistent); - } + //! \copydoc ResourceManager::set_persistent + void set_persistent(const Asset & asset, bool persistent); /** * \name Logging functions * \see Log -- cgit v1.2.3 From ded2f0d56d95edffb97830f406bce9e1ec4293d1 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Fri, 13 Dec 2024 20:48:44 +0100 Subject: make format --- src/crepe/api/Scene.cpp | 10 +++++----- src/crepe/api/Scene.h | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/crepe/api/Scene.cpp') diff --git a/src/crepe/api/Scene.cpp b/src/crepe/api/Scene.cpp index 9a2a1bc..ad729d2 100644 --- a/src/crepe/api/Scene.cpp +++ b/src/crepe/api/Scene.cpp @@ -4,12 +4,12 @@ using namespace crepe; SaveManager & Scene::get_save_manager() const { return mediator->save_manager; } -GameObject Scene::new_object(const std::string & name, const std::string & tag, const vec2 & position, double rotation, double scale) { - // Forward the call to ComponentManager's new_object method - return mediator->component_manager->new_object(name, tag, position, rotation, scale); +GameObject Scene::new_object(const std::string & name, const std::string & tag, + const vec2 & position, double rotation, double scale) { + // Forward the call to ComponentManager's new_object method + return mediator->component_manager->new_object(name, tag, position, rotation, scale); } - void Scene::set_persistent(const Asset & asset, bool persistent) { - mediator->resource_manager->set_persistent(asset, persistent); + mediator->resource_manager->set_persistent(asset, persistent); } diff --git a/src/crepe/api/Scene.h b/src/crepe/api/Scene.h index e70d9ba..dcca9d4 100644 --- a/src/crepe/api/Scene.h +++ b/src/crepe/api/Scene.h @@ -5,8 +5,8 @@ #include "../manager/ComponentManager.h" #include "../manager/Mediator.h" #include "../manager/ResourceManager.h" -#include "../util/OptionalRef.h" #include "../util/Log.h" +#include "../util/OptionalRef.h" #include "GameObject.h" @@ -69,10 +69,11 @@ protected: SaveManager & get_save_manager() const; //! \copydoc ComponentManager::new_object - GameObject new_object(const std::string & name, const std::string & tag = "", const vec2 & position = {0, 0}, double rotation = 0, double scale = 1); - + GameObject new_object(const std::string & name, const std::string & tag = "", + const vec2 & position = {0, 0}, double rotation = 0, + double scale = 1); - //! \copydoc ResourceManager::set_persistent + //! \copydoc ResourceManager::set_persistent void set_persistent(const Asset & asset, bool persistent); /** * \name Logging functions -- cgit v1.2.3