aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Resource.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/Resource.h')
-rw-r--r--src/crepe/Resource.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/crepe/Resource.h b/src/crepe/Resource.h
index a0c8859..d65206b 100644
--- a/src/crepe/Resource.h
+++ b/src/crepe/Resource.h
@@ -4,23 +4,27 @@ namespace crepe {
class ResourceManager;
class Asset;
+class Mediator;
/**
- * Resource is an interface class used to represent a (deserialized) game
- * resource (e.g. textures, sounds).
+ * \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);
+ Resource(const Asset & src, Mediator & mediator);
virtual ~Resource() = default;
-private:
- /**
- * The resource manager uses \c clone to create new instances of the concrete
- * resource class. This may be used to inherit references to classes that
- * would otherwise need to be implemented as singletons.
- */
- friend class ResourceManager;
+ Resource(const Resource &) = delete;
+ Resource(Resource &&) = delete;
+ Resource & operator=(const Resource &) = delete;
+ Resource & operator=(Resource &&) = delete;
};
} // namespace crepe