PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
ResourceLocator.hpp
1#pragma once
2
3#include "PixelBullet/Filesystem/Link.hpp"
4#include "PixelBullet/Filesystem/Resources/Resources.hpp"
5
6#include <string>
7
8namespace PixelBullet
9{
11 {
12 public:
14 ResourceLocator(const std::string& assetBasePath = "");
15
17 std::string ResolveAssetPath(const std::string& relativePath) const;
18
20 void RegisterAssetLink(const std::string& alias, const std::string& path);
21
23 void LoadAssetLinksFromFile(const std::string& filename);
24
27 {
28 return m_Resources;
29 }
30 const Resources& GetResources() const
31 {
32 return m_Resources;
33 }
34
35 private:
36 Link m_Link;
37 std::string m_AssetBasePath;
38 Resources m_Resources;
39 };
40} // namespace PixelBullet
Definition ResourceLocator.hpp:11
ResourceLocator(const std::string &assetBasePath="")
An assetBasePath is an optional path segment from the app specification.
Definition ResourceLocator.cpp:10
std::string ResolveAssetPath(const std::string &relativePath) const
Resolve a relative asset path (which may start with an alias) into an absolute file system path.
Definition ResourceLocator.cpp:15
void LoadAssetLinksFromFile(const std::string &filename)
Load asset link mappings from a configuration file.
Definition ResourceLocator.cpp:44
void RegisterAssetLink(const std::string &alias, const std::string &path)
Register a new asset alias.
Definition ResourceLocator.cpp:39
Resources & GetResources()
Access the embedded resource manager.
Definition ResourceLocator.hpp:26
Definition Resources.hpp:21