diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-12 15:05:33 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-12 15:05:33 +0100 |
commit | 641e202607b0f694df6662532f0165022c0f8621 (patch) | |
tree | 0701bbfe705a95b670c8dfcb5eaabf6007556831 /src/crepe/Resource.h | |
parent | dd7d5cf6b01b8a6a4238b66c27861ee76522067e (diff) | |
parent | 05a33d4793520fa84a93bc79882ef29d39cd08e5 (diff) |
merge master
Diffstat (limited to 'src/crepe/Resource.h')
-rw-r--r-- | src/crepe/Resource.h | 30 |
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 |