aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Resource.h
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-11 20:12:12 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-11 20:12:12 +0100
commitc90423d5c9d38ae426c168e52994a4fd63e6f266 (patch)
treefa18eae598cf0fccbb0f2dffd3e1d76fedaed53a /src/crepe/Resource.h
parent9b4f6f24f29e8873a14989ba8c9fccfbc460af7f (diff)
parent194ee3f192c3343c3ccc28dfa97fed180503ffd4 (diff)
merge master
Diffstat (limited to 'src/crepe/Resource.h')
-rw-r--r--src/crepe/Resource.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/crepe/Resource.h b/src/crepe/Resource.h
new file mode 100644
index 0000000..d65206b
--- /dev/null
+++ b/src/crepe/Resource.h
@@ -0,0 +1,30 @@
+#pragma once
+
+namespace crepe {
+
+class ResourceManager;
+class Asset;
+class Mediator;
+
+/**
+ * \brief Resource interface
+ *
+ * Resource is an interface class used to represent a (deserialized) game resource (e.g.
+ * textures, sounds). Resources are always created from \ref Asset "assets" by ResourceManager.
+ *
+ * The game programmer has the ability to use the ResourceManager to keep instances of concrete
+ * resources between scenes, preventing them from being reinstantiated during a scene
+ * transition.
+ */
+class Resource {
+public:
+ Resource(const Asset & src, Mediator & mediator);
+ virtual ~Resource() = default;
+
+ Resource(const Resource &) = delete;
+ Resource(Resource &&) = delete;
+ Resource & operator=(const Resource &) = delete;
+ Resource & operator=(Resource &&) = delete;
+};
+
+} // namespace crepe