| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

Resource.h
Go to the documentation of this file.
1 #pragma once
2
3 #include "Platform.h"
4 #include "FlingTypes.h"
5
6 namespace Fling
7 {
11 class Resource
12 {
13 friend class ResourceManager;
14
15 public:
16 explicit Resource(Fling::Guid t_ID)
17 : m_Guid(t_ID)
18 {
19 m_HumanReadableName = m_Guid.data();
20 }
21
22 virtual ~Resource() = default;
23
30 Fling::Guid_Handle GetGuidHandle() const { return m_Guid; }
31
37 const std::string& GetGuidString() const { return m_HumanReadableName; }
38
42 std::string GetFilepathReleativeToAssets() const;
43
44 protected:
45
46 Fling::Guid m_Guid;
47
48 std::string m_HumanReadableName;
49 };
50 } // namespace Fling
Fling::Resource::GetGuidHandle
Fling::Guid_Handle GetGuidHandle() const
Get GUID handle (just an int) for this resources guid.
Definition: Resource.h:30
Fling::Resource::GetFilepathReleativeToAssets
std::string GetFilepathReleativeToAssets() const
Returns the full file path that is relative to the assets path based on the GUID of this resource...
Definition: Resource.cpp:6
Fling::Resource::Resource
Resource(Fling::Guid t_ID)
Definition: Resource.h:16
Fling::Resource
Base class that represents a loaded resource in the engine.
Definition: Resource.h:11
Fling::Guid_Handle
entt::hashed_string::hash_type Guid_Handle
Definition: FlingTypes.h:27
Fling::Resource::m_HumanReadableName
std::string m_HumanReadableName
Definition: Resource.h:48
Fling::Resource::m_Guid
Fling::Guid m_Guid
Definition: Resource.h:46
Fling::Guid
entt::hashed_string Guid
Definition: FlingTypes.h:26
Fling::ResourceManager
The resource manager handles loading of files off disk.
Definition: ResourceManager.h:23
Fling::Resource::~Resource
virtual ~Resource()=default
Fling::Resource::GetGuidString
const std::string & GetGuidString() const
Get the human-readable string representation of this GUID.
Definition: Resource.h:37
Fling
Definition: Engine.h:29
FlingTypes.h
Platform.h