Cytopia  0.3
A city building simulation game
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResourceManager.inl.hxx
Go to the documentation of this file.
1 
2 template <typename ResourceID> struct ResourceManager::resource_type
3 {
4 };
5 
6 #ifdef USE_AUDIO
8 {
9  using type = SoundtrackUPtr &;
10 };
11 #endif // USE_AUDIO
12 
13 template <typename ResourceID>
15 {
16  fetch(id);
17 #ifdef USE_AUDIO
18  if constexpr (std::is_same_v<ResourceID, SoundtrackID>)
19  return m_soundtracks.at(id).resource;
20 #endif // USE_AUDIO
21 }
StrongType< string, struct SoundtrackIDTag >
SoundtrackUPtr
std::unique_ptr< Soundtrack > SoundtrackUPtr
Definition: Soundtrack.hxx:98
ResourceManager::resource_type
Definition: ResourceManager.hxx:60
ResourceManager::get
resource_type< ResourceID >::type get(const ResourceID &)
Fetches and return a Soundtrack.
Definition: ResourceManager.inl.hxx:14