From 8d78727d6e7badca16ba7a1328643928a0039569 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Mon, 18 Nov 2024 18:02:09 +0100 Subject: move utilities from loek/audio --- src/crepe/util/OptionalRef.hpp | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/crepe/util/OptionalRef.hpp (limited to 'src/crepe/util/OptionalRef.hpp') diff --git a/src/crepe/util/OptionalRef.hpp b/src/crepe/util/OptionalRef.hpp new file mode 100644 index 0000000..7b201b0 --- /dev/null +++ b/src/crepe/util/OptionalRef.hpp @@ -0,0 +1,67 @@ +#pragma once + +#include + +#include "OptionalRef.h" + +namespace crepe { + +template +OptionalRef::OptionalRef(T & ref) { + this->set(ref); +} + +template +OptionalRef::OptionalRef(const OptionalRef & other) { + this->ref = other.ref; +} + +template +OptionalRef::OptionalRef(OptionalRef && other) { + this->ref = other.ref; + other.clear(); +} + +template +OptionalRef & OptionalRef::operator=(const OptionalRef & other) { + this->ref = other.ref; + return *this; +} + +template +OptionalRef & OptionalRef::operator=(OptionalRef && other) { + this->ref = other.ref; + other.clear(); + return *this; +} + +template +T & OptionalRef::get() const { + if (this->ref == nullptr) + throw std::runtime_error("OptionalRef: attempt to dereference nullptr"); + return *this->ref; +} + +template +void OptionalRef::set(T & ref) noexcept { + this->ref = &ref; +} + +template +void OptionalRef::clear() noexcept { + this->ref = nullptr; +} + +template +OptionalRef & OptionalRef::operator=(T & ref) { + this->set(ref); + return *this; +} + +template +OptionalRef::operator bool() const noexcept { + return this->ref != nullptr; +} + +} + -- cgit v1.2.3 From 02845c3d25130e9473604cb2eeee42a7a7a8eadf Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 20 Nov 2024 14:01:31 +0100 Subject: `make format` --- src/crepe/api/Asset.cpp | 15 +++++---------- src/crepe/api/Asset.h | 8 ++++---- src/crepe/types.h | 4 ++-- src/crepe/util/OptionalRef.h | 13 ++++++------- src/crepe/util/OptionalRef.hpp | 3 +-- src/example/rendering.cpp | 5 ++--- src/test/AssetTest.cpp | 13 +++---------- src/test/OptionalRefTest.cpp | 1 - 8 files changed, 23 insertions(+), 39 deletions(-) (limited to 'src/crepe/util/OptionalRef.hpp') diff --git a/src/crepe/api/Asset.cpp b/src/crepe/api/Asset.cpp index 5271cf7..3fe3ceb 100644 --- a/src/crepe/api/Asset.cpp +++ b/src/crepe/api/Asset.cpp @@ -8,8 +8,8 @@ using namespace crepe; using namespace std; -Asset::Asset(const string & src) : src(find_asset(src)) { } -Asset::Asset(const char * src) : src(find_asset(src)) { } +Asset::Asset(const string & src) : src(find_asset(src)) {} +Asset::Asset(const char * src) : src(find_asset(src)) {} const string & Asset::get_path() const noexcept { return this->src; } @@ -22,14 +22,12 @@ string Asset::find_asset(const string & src) const { // absolute paths do not need to be resolved, only canonicalized filesystem::path path = src; - if (path.is_absolute()) - return filesystem::canonical(path); + if (path.is_absolute()) return filesystem::canonical(path); // find directory matching root_pattern filesystem::path root = this->whereami(); while (1) { - if (filesystem::exists(root / root_pattern)) - break; + if (filesystem::exists(root / root_pattern)) break; if (!root.has_parent_path()) throw runtime_error(format("Asset: Cannot find root pattern ({})", root_pattern)); root = root.parent_path(); @@ -48,11 +46,8 @@ string Asset::whereami() const noexcept { return path; } -bool Asset::operator==(const Asset & other) const noexcept { - return this->src == other.src; -} +bool Asset::operator==(const Asset & other) const noexcept { return this->src == other.src; } size_t std::hash::operator()(const Asset & asset) const noexcept { return std::hash{}(asset.get_path()); }; - diff --git a/src/crepe/api/Asset.h b/src/crepe/api/Asset.h index 685dd3a..77596ac 100644 --- a/src/crepe/api/Asset.h +++ b/src/crepe/api/Asset.h @@ -33,7 +33,7 @@ public: * \param other Possibly different instance of \c Asset to test equality against * \return True if \c this and \c other are equal */ - bool operator == (const Asset & other) const noexcept; + bool operator==(const Asset & other) const noexcept; private: //! path to asset @@ -52,7 +52,8 @@ private: namespace std { //! Hash helper struct -template<> struct hash { +template <> +struct hash { /** * \brief Hash operator for crepe::Asset * @@ -64,5 +65,4 @@ template<> struct hash { size_t operator()(const crepe::Asset & asset) const noexcept; }; -} - +} // namespace std diff --git a/src/crepe/types.h b/src/crepe/types.h index 86730cc..914c76c 100644 --- a/src/crepe/types.h +++ b/src/crepe/types.h @@ -1,8 +1,8 @@ #pragma once #include -#include #include +#include namespace crepe { @@ -13,4 +13,4 @@ typedef uint32_t game_object_id_t; template using RefVector = std::vector>; -} +} // namespace crepe diff --git a/src/crepe/util/OptionalRef.h b/src/crepe/util/OptionalRef.h index 8417a25..0a94ae5 100644 --- a/src/crepe/util/OptionalRef.h +++ b/src/crepe/util/OptionalRef.h @@ -23,7 +23,7 @@ public: * * \return Reference to this (required for operator) */ - OptionalRef & operator=(T & ref); + OptionalRef & operator=(T & ref); /** * \brief Check if this reference is not empty * @@ -51,13 +51,13 @@ public: void clear() noexcept; //! Copy constructor - OptionalRef(const OptionalRef &); + OptionalRef(const OptionalRef &); //! Move constructor - OptionalRef(OptionalRef &&); + OptionalRef(OptionalRef &&); //! Copy assignment - OptionalRef & operator=(const OptionalRef &); + OptionalRef & operator=(const OptionalRef &); //! Move assignment - OptionalRef & operator=(OptionalRef &&); + OptionalRef & operator=(OptionalRef &&); private: /** @@ -68,7 +68,6 @@ private: T * ref = nullptr; }; -} +} // namespace crepe #include "OptionalRef.hpp" - diff --git a/src/crepe/util/OptionalRef.hpp b/src/crepe/util/OptionalRef.hpp index 7b201b0..ee41f61 100644 --- a/src/crepe/util/OptionalRef.hpp +++ b/src/crepe/util/OptionalRef.hpp @@ -63,5 +63,4 @@ OptionalRef::operator bool() const noexcept { return this->ref != nullptr; } -} - +} // namespace crepe diff --git a/src/example/rendering.cpp b/src/example/rendering.cpp index 522ec0f..01794f8 100644 --- a/src/example/rendering.cpp +++ b/src/example/rendering.cpp @@ -30,9 +30,8 @@ int main() { // Normal adding components { Color color(0, 0, 0, 0); - Sprite & sprite - = obj.add_component(make_shared("asset/texture/img.png"), - color, FlipSettings{false, false}); + Sprite & sprite = obj.add_component( + make_shared("asset/texture/img.png"), color, FlipSettings{false, false}); sprite.sorting_in_layer = 2; sprite.order_in_layer = 1; obj.add_component(Color::RED); diff --git a/src/test/AssetTest.cpp b/src/test/AssetTest.cpp index 563a253..8aa7629 100644 --- a/src/test/AssetTest.cpp +++ b/src/test/AssetTest.cpp @@ -10,18 +10,12 @@ using namespace testing; class AssetTest : public Test { public: Config & cfg = Config::get_instance(); - void SetUp() override { - this->cfg.asset.root_pattern = ".crepe-root"; - } + void SetUp() override { this->cfg.asset.root_pattern = ".crepe-root"; } }; -TEST_F(AssetTest, Existant) { - ASSERT_NO_THROW(Asset{"asset/texture/img.png"}); -} +TEST_F(AssetTest, Existant) { ASSERT_NO_THROW(Asset{"asset/texture/img.png"}); } -TEST_F(AssetTest, Nonexistant) { - ASSERT_ANY_THROW(Asset{"asset/nonexistant"}); -} +TEST_F(AssetTest, Nonexistant) { ASSERT_ANY_THROW(Asset{"asset/nonexistant"}); } TEST_F(AssetTest, Rootless) { cfg.asset.root_pattern.clear(); @@ -30,4 +24,3 @@ TEST_F(AssetTest, Rootless) { Asset asset{arbitrary}; ASSERT_EQ(arbitrary, asset.get_path()); } - diff --git a/src/test/OptionalRefTest.cpp b/src/test/OptionalRefTest.cpp index 219ccca..2072d56 100644 --- a/src/test/OptionalRefTest.cpp +++ b/src/test/OptionalRefTest.cpp @@ -35,4 +35,3 @@ TEST(OptionalRefTest, Implicit) { EXPECT_TRUE(ref); ASSERT_NO_THROW(ref.get()); } - -- cgit v1.2.3 From 22a7e9f3c40b4b6eb68a5343e4870e76c4bfcf63 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 20 Nov 2024 14:24:08 +0100 Subject: process feedback on #39 --- readme.md | 7 +++++++ src/crepe/ComponentManager.h | 5 +++-- src/crepe/ComponentManager.hpp | 9 ++++----- src/crepe/api/Asset.cpp | 5 +++-- src/crepe/api/Asset.h | 16 ++++++++++++++++ src/crepe/system/System.h | 2 -- src/crepe/util/OptionalRef.h | 11 +---------- src/crepe/util/OptionalRef.hpp | 24 ------------------------ 8 files changed, 34 insertions(+), 45 deletions(-) (limited to 'src/crepe/util/OptionalRef.hpp') diff --git a/readme.md b/readme.md index c83853d..d309b30 100644 --- a/readme.md +++ b/readme.md @@ -32,6 +32,7 @@ This project uses the following libraries |`SoLoud`|(latest git `master` version)| |Google Test (`GTest`)|1.15.2| |Berkeley DB (`libdb`)|5.3.21| +|Where Am I?|(latest git `master` version) > [!NOTE] > Most of these libraries are likely available from your package manager if you @@ -49,6 +50,11 @@ $ git submodule update --init --recursive --depth 1 Then, follow these steps for each library you want to install: +> [!IMPORTANT] +> A dollar sign prompt (`$`) indicates commands to be run as a regular user, +> while a hashtag (`#`) is used to denote commands that must be run with +> privileges (e.g. as root or using `sudo`). + 1. Change into the library folder (run **one** of these): ``` $ cd lib/googletest @@ -56,6 +62,7 @@ Then, follow these steps for each library you want to install: $ cd lib/soloud/contrib $ cd lib/sdl_image $ cd lib/sdl_ttf + $ cd lib/whereami ``` 2. Use CMake to configure the build, run the build and install (run **all** of these): diff --git a/src/crepe/ComponentManager.h b/src/crepe/ComponentManager.h index 2107453..0956d1e 100644 --- a/src/crepe/ComponentManager.h +++ b/src/crepe/ComponentManager.h @@ -8,6 +8,7 @@ #include "api/Vector2.h" #include "Component.h" +#include "types.h" namespace crepe { @@ -112,7 +113,7 @@ public: * \return A vector of all components of the specific type and id */ template - std::vector> get_components_by_id(game_object_id_t id) const; + RefVector get_components_by_id(game_object_id_t id) const; /** * \brief Get all components of a specific type * @@ -122,7 +123,7 @@ public: * \return A vector of all components of the specific type */ template - std::vector> get_components_by_type() const; + RefVector get_components_by_type() const; private: /** diff --git a/src/crepe/ComponentManager.hpp b/src/crepe/ComponentManager.hpp index be99cac..4d5eaf4 100644 --- a/src/crepe/ComponentManager.hpp +++ b/src/crepe/ComponentManager.hpp @@ -81,15 +81,14 @@ void ComponentManager::delete_components() { } template -std::vector> -ComponentManager::get_components_by_id(game_object_id_t id) const { +RefVector ComponentManager::get_components_by_id(game_object_id_t id) const { using namespace std; // Determine the type of T (this is used as the key of the unordered_map<>) type_index type = typeid(T); // Create an empty vector<> - vector> component_vector; + RefVector component_vector; if (this->components.find(type) == this->components.end()) return component_vector; @@ -114,14 +113,14 @@ ComponentManager::get_components_by_id(game_object_id_t id) const { } template -std::vector> ComponentManager::get_components_by_type() const { +RefVector ComponentManager::get_components_by_type() const { using namespace std; // Determine the type of T (this is used as the key of the unordered_map<>) type_index type = typeid(T); // Create an empty vector<> - vector> component_vector; + RefVector component_vector; // Find the type (in the unordered_map<>) if (this->components.find(type) == this->components.end()) return component_vector; diff --git a/src/crepe/api/Asset.cpp b/src/crepe/api/Asset.cpp index 3fe3ceb..e148367 100644 --- a/src/crepe/api/Asset.cpp +++ b/src/crepe/api/Asset.cpp @@ -2,9 +2,10 @@ #include #include -#include "Asset.h" #include "api/Config.h" +#include "Asset.h" + using namespace crepe; using namespace std; @@ -15,7 +16,7 @@ const string & Asset::get_path() const noexcept { return this->src; } string Asset::find_asset(const string & src) const { auto & cfg = Config::get_instance(); - auto & root_pattern = cfg.asset.root_pattern; + string & root_pattern = cfg.asset.root_pattern; // if root_pattern is empty, find_asset must return all paths as-is if (root_pattern.empty()) return src; diff --git a/src/crepe/api/Asset.h b/src/crepe/api/Asset.h index 77596ac..bfd0ac7 100644 --- a/src/crepe/api/Asset.h +++ b/src/crepe/api/Asset.h @@ -40,6 +40,22 @@ private: const std::string src; private: + /** + * \brief Locate asset path, or throw exception if it cannot be found + * + * This function resolves asset locations relative to crepe::Config::root_pattern if it is + * set and \p src is a relative path. If \p src is an absolute path, it is canonicalized. + * This function only returns if the file can be found. + * + * \param src Arbitrary path to resource file + * + * \returns \p src if crepe::Config::root_pattern is empty + * \returns Canonical path to \p src + * + * \throws std::runtime_error if root_pattern cannot be found + * \throws std::filesystem::filesystem_error if the resolved path does not exist + * \throws std::filesystem::filesystem_error if the path cannot be canonicalized + */ std::string find_asset(const std::string & src) const; /** * \returns The path to the current executable diff --git a/src/crepe/system/System.h b/src/crepe/system/System.h index 36f7edc..28ea20e 100644 --- a/src/crepe/system/System.h +++ b/src/crepe/system/System.h @@ -1,7 +1,5 @@ #pragma once -#include "../ComponentManager.h" - namespace crepe { class ComponentManager; diff --git a/src/crepe/util/OptionalRef.h b/src/crepe/util/OptionalRef.h index 0a94ae5..57f9635 100644 --- a/src/crepe/util/OptionalRef.h +++ b/src/crepe/util/OptionalRef.h @@ -36,7 +36,7 @@ public: * * \param ref Reference to assign */ - void set(T &) noexcept; + void set(T & ref) noexcept; /** * \brief Retrieve this reference * @@ -50,15 +50,6 @@ public: */ void clear() noexcept; - //! Copy constructor - OptionalRef(const OptionalRef &); - //! Move constructor - OptionalRef(OptionalRef &&); - //! Copy assignment - OptionalRef & operator=(const OptionalRef &); - //! Move assignment - OptionalRef & operator=(OptionalRef &&); - private: /** * \brief Reference to the value of type \c T diff --git a/src/crepe/util/OptionalRef.hpp b/src/crepe/util/OptionalRef.hpp index ee41f61..71e2a39 100644 --- a/src/crepe/util/OptionalRef.hpp +++ b/src/crepe/util/OptionalRef.hpp @@ -11,30 +11,6 @@ OptionalRef::OptionalRef(T & ref) { this->set(ref); } -template -OptionalRef::OptionalRef(const OptionalRef & other) { - this->ref = other.ref; -} - -template -OptionalRef::OptionalRef(OptionalRef && other) { - this->ref = other.ref; - other.clear(); -} - -template -OptionalRef & OptionalRef::operator=(const OptionalRef & other) { - this->ref = other.ref; - return *this; -} - -template -OptionalRef & OptionalRef::operator=(OptionalRef && other) { - this->ref = other.ref; - other.clear(); - return *this; -} - template T & OptionalRef::get() const { if (this->ref == nullptr) -- cgit v1.2.3 From 9d66b6cfccd15a1600c30af5e744e8b0710eeae6 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 21 Nov 2024 09:29:15 +0100 Subject: remove OptionalRef::set and OptionalRef::get --- src/crepe/util/OptionalRef.h | 22 ++++++++-------------- src/crepe/util/OptionalRef.hpp | 21 ++++++++------------- src/test/OptionalRefTest.cpp | 42 ++++++++++++++++++++++++++---------------- 3 files changed, 42 insertions(+), 43 deletions(-) (limited to 'src/crepe/util/OptionalRef.hpp') diff --git a/src/crepe/util/OptionalRef.h b/src/crepe/util/OptionalRef.h index 57f9635..253bc07 100644 --- a/src/crepe/util/OptionalRef.h +++ b/src/crepe/util/OptionalRef.h @@ -24,19 +24,6 @@ public: * \return Reference to this (required for operator) */ OptionalRef & operator=(T & ref); - /** - * \brief Check if this reference is not empty - * - * \returns `true` if reference is set, or `false` if it is not - */ - explicit operator bool() const noexcept; - - /** - * \brief Assign new reference - * - * \param ref Reference to assign - */ - void set(T & ref) noexcept; /** * \brief Retrieve this reference * @@ -44,7 +31,14 @@ public: * * \throws std::runtime_error if this function is called while the reference it not set */ - T & get() const; + operator T & () const; + /** + * \brief Check if this reference is not empty + * + * \returns `true` if reference is set, or `false` if it is not + */ + explicit operator bool() const noexcept; + /** * \brief Make this reference empty */ diff --git a/src/crepe/util/OptionalRef.hpp b/src/crepe/util/OptionalRef.hpp index 71e2a39..ae7c73e 100644 --- a/src/crepe/util/OptionalRef.hpp +++ b/src/crepe/util/OptionalRef.hpp @@ -8,29 +8,19 @@ namespace crepe { template OptionalRef::OptionalRef(T & ref) { - this->set(ref); + this->ref = &ref; } template -T & OptionalRef::get() const { +OptionalRef::operator T & () const { if (this->ref == nullptr) throw std::runtime_error("OptionalRef: attempt to dereference nullptr"); return *this->ref; } -template -void OptionalRef::set(T & ref) noexcept { - this->ref = &ref; -} - -template -void OptionalRef::clear() noexcept { - this->ref = nullptr; -} - template OptionalRef & OptionalRef::operator=(T & ref) { - this->set(ref); + this->ref = &ref; return *this; } @@ -39,4 +29,9 @@ OptionalRef::operator bool() const noexcept { return this->ref != nullptr; } +template +void OptionalRef::clear() noexcept { + this->ref = nullptr; +} + } // namespace crepe diff --git a/src/test/OptionalRefTest.cpp b/src/test/OptionalRefTest.cpp index 2072d56..1c69348 100644 --- a/src/test/OptionalRefTest.cpp +++ b/src/test/OptionalRefTest.cpp @@ -6,32 +6,42 @@ using namespace std; using namespace crepe; using namespace testing; -TEST(OptionalRefTest, Explicit) { +TEST(OptionalRefTest, Normal) { string value = "foo"; - OptionalRef ref; - EXPECT_FALSE(ref); - ASSERT_THROW(ref.get(), runtime_error); + OptionalRef ref = value; - ref.set(value); EXPECT_TRUE(ref); - ASSERT_NO_THROW(ref.get()); + ASSERT_NO_THROW({ + string & value_ref = ref; + EXPECT_EQ(value_ref, value); + }); ref.clear(); EXPECT_FALSE(ref); - ASSERT_THROW(ref.get(), runtime_error); + ASSERT_THROW({ + string & value_ref = ref; + }, runtime_error); } -TEST(OptionalRefTest, Implicit) { +TEST(OptionalRefTest, Empty) { string value = "foo"; - OptionalRef ref = value; - EXPECT_TRUE(ref); - ASSERT_NO_THROW(ref.get()); + OptionalRef ref; - ref.clear(); EXPECT_FALSE(ref); - ASSERT_THROW(ref.get(), runtime_error); + ASSERT_THROW({ + string & value_ref = ref; + }, runtime_error); +} - ref = value; - EXPECT_TRUE(ref); - ASSERT_NO_THROW(ref.get()); +TEST(OptionalRefTest, Chain) { + string value = "foo"; + OptionalRef ref1 = value; + OptionalRef ref2 = ref1; + + EXPECT_TRUE(ref2); + string & value_ref = ref2; + EXPECT_EQ(value_ref, value); + value_ref = "bar"; + EXPECT_EQ(value_ref, value); } + -- cgit v1.2.3 From 115d6f50152dc018073345800ca90b85846ebaa9 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 21 Nov 2024 10:01:04 +0100 Subject: `make format` --- src/crepe/util/OptionalRef.h | 2 +- src/crepe/util/OptionalRef.hpp | 2 +- src/test/OptionalRefTest.cpp | 9 ++------- src/test/SceneManagerTest.cpp | 4 ++-- 4 files changed, 6 insertions(+), 11 deletions(-) (limited to 'src/crepe/util/OptionalRef.hpp') diff --git a/src/crepe/util/OptionalRef.h b/src/crepe/util/OptionalRef.h index 253bc07..3201667 100644 --- a/src/crepe/util/OptionalRef.h +++ b/src/crepe/util/OptionalRef.h @@ -31,7 +31,7 @@ public: * * \throws std::runtime_error if this function is called while the reference it not set */ - operator T & () const; + operator T &() const; /** * \brief Check if this reference is not empty * diff --git a/src/crepe/util/OptionalRef.hpp b/src/crepe/util/OptionalRef.hpp index ae7c73e..4608c9e 100644 --- a/src/crepe/util/OptionalRef.hpp +++ b/src/crepe/util/OptionalRef.hpp @@ -12,7 +12,7 @@ OptionalRef::OptionalRef(T & ref) { } template -OptionalRef::operator T & () const { +OptionalRef::operator T &() const { if (this->ref == nullptr) throw std::runtime_error("OptionalRef: attempt to dereference nullptr"); return *this->ref; diff --git a/src/test/OptionalRefTest.cpp b/src/test/OptionalRefTest.cpp index 1c69348..83f7b23 100644 --- a/src/test/OptionalRefTest.cpp +++ b/src/test/OptionalRefTest.cpp @@ -18,9 +18,7 @@ TEST(OptionalRefTest, Normal) { ref.clear(); EXPECT_FALSE(ref); - ASSERT_THROW({ - string & value_ref = ref; - }, runtime_error); + ASSERT_THROW({ string & value_ref = ref; }, runtime_error); } TEST(OptionalRefTest, Empty) { @@ -28,9 +26,7 @@ TEST(OptionalRefTest, Empty) { OptionalRef ref; EXPECT_FALSE(ref); - ASSERT_THROW({ - string & value_ref = ref; - }, runtime_error); + ASSERT_THROW({ string & value_ref = ref; }, runtime_error); } TEST(OptionalRefTest, Chain) { @@ -44,4 +40,3 @@ TEST(OptionalRefTest, Chain) { value_ref = "bar"; EXPECT_EQ(value_ref, value); } - diff --git a/src/test/SceneManagerTest.cpp b/src/test/SceneManagerTest.cpp index dab2ce9..1efcfb2 100644 --- a/src/test/SceneManagerTest.cpp +++ b/src/test/SceneManagerTest.cpp @@ -21,7 +21,7 @@ public: GameObject object3 = mgr.new_object("scene_1", "tag_scene_1", Vector2{2, 0}, 0, 1); } - string get_name() const { return "scene1";} + string get_name() const { return "scene1"; } }; class ConcreteScene2 : public Scene { @@ -36,7 +36,7 @@ public: GameObject object4 = mgr.new_object("scene_2", "tag_scene_2", Vector2{0, 3}, 0, 1); } - string get_name() const { return "scene2";} + string get_name() const { return "scene2"; } }; class SceneManagerTest : public ::testing::Test { -- cgit v1.2.3