diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-12-11 13:21:19 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-12-11 13:21:19 +0100 |
commit | 357ebfc3eac1d39b02875e1bd78ae6f58b10f824 (patch) | |
tree | 7d79435fa764c0fedcc912ddaf876ff03ef8be5e /src/crepe/Resource.h | |
parent | 6eef90e9ffb1d8fc25161e912bc5d8aa8e4024da (diff) | |
parent | c45b60941b82dec2097d958b396a117b1634eada (diff) |
Merge remote-tracking branch 'origin/master' into max/AI
Diffstat (limited to 'src/crepe/Resource.h')
-rw-r--r-- | src/crepe/Resource.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/crepe/Resource.h b/src/crepe/Resource.h new file mode 100644 index 0000000..eceb15b --- /dev/null +++ b/src/crepe/Resource.h @@ -0,0 +1,29 @@ +#pragma once + +namespace crepe { + +class ResourceManager; +class Asset; + +/** + * \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); + virtual ~Resource() = default; + + Resource(const Resource &) = delete; + Resource(Resource &&) = delete; + Resource & operator=(const Resource &) = delete; + Resource & operator=(Resource &&) = delete; +}; + +} // namespace crepe |