HoverRace
2.0
|
Represents a file in the game's media directory. More...
#include <MediaRes.h>
Public Member Functions | |
MediaRes (const Util::OS::path_t &path) | |
Constructor. More... | |
virtual | ~MediaRes () |
std::string | GetId () const override |
Retrieve the ID for this resource. More... | |
std::unique_ptr< std::istream > | Open () const override |
Open the stream for reading. More... | |
![]() | |
virtual | ~Res () |
![]() | |
virtual | ~BaseRes () |
Private Types | |
using | SUPER = Res< T > |
Private Attributes | |
std::string | id |
Util::OS::path_t | path |
Represents a file in the game's media directory.
|
private |
|
inline |
Constructor.
path | File path, relative to the media directory. |
|
inlinevirtual |
|
inlineoverridevirtual |
Retrieve the ID for this resource.
The ID should be unique for every resource being pointed at, so two instances that point to the same resource (e.g. a file) should return the same ID.
This allows loaded resources to be cached, so if two instances point to, say, the same file, then the resource will be loaded once (although this is left as an exercise for the Display).
Implements HoverRace::Display::BaseRes.
|
inlineoverridevirtual |
Open the stream for reading.
ResourceLoadExn |
Implements HoverRace::Display::BaseRes.
|
private |
|
private |