aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-11-21 09:30:23 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-11-21 09:30:23 +0100
commitba93a8deaf7ba4e68c25d74c58637450cbe0e056 (patch)
tree5c5b8b0f833ced5245bea0bd0e0c059f845cc903
parent2f7f7ef167924be7db75aae2cd3f16ec50323980 (diff)
Added const
-rw-r--r--src/crepe/api/Scene.h2
-rw-r--r--src/example/scene_manager.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/crepe/api/Scene.h b/src/crepe/api/Scene.h
index 74cfac3..869bf6f 100644
--- a/src/crepe/api/Scene.h
+++ b/src/crepe/api/Scene.h
@@ -33,7 +33,7 @@ public:
* \brief Get the scene's name
* \return The scene's name
*/
- virtual std::string get_name() = 0;
+ virtual std::string get_name() const = 0;
protected:
//! Reference to the ComponentManager
diff --git a/src/example/scene_manager.cpp b/src/example/scene_manager.cpp
index 7277afa..2ab45f9 100644
--- a/src/example/scene_manager.cpp
+++ b/src/example/scene_manager.cpp
@@ -1,6 +1,6 @@
#define private public
-#include "api/LoopManager.h"
+#include <crepe/api/LoopManager.h>
#include <iostream>
#include <crepe/ComponentManager.h>
@@ -24,7 +24,7 @@ public:
GameObject object3 = mgr.new_object("scene_1", "tag_scene_1", Vector2{2, 0}, 0, 1);
}
- string get_name() { return "scene1"; }
+ string get_name() const { return "scene1"; }
};
class ConcreteScene2 : public Scene {
@@ -39,7 +39,7 @@ public:
GameObject object4 = mgr.new_object("scene_2", "tag_scene_2", Vector2{0, 3}, 0, 1);
}
- string get_name() { return "scene2"; }
+ string get_name() const { return "scene2"; }
};
int main() {