Cytopia
0.3
A city building simulation game
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
7
template
<>
struct
ResourceManager::resource_type
<
SoundtrackID
>
8
{
9
using
type =
SoundtrackUPtr
&;
10
};
11
#endif // USE_AUDIO
12
13
template
<
typename
ResourceID>
14
typename
ResourceManager::resource_type<ResourceID>::type
ResourceManager::get
(
const
ResourceID &
id
)
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
src
services
ResourceManager.inl.hxx
Generated on Sun Nov 27 2022 09:50:52 for Cytopia by
1.8.17