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 
31 
37  const std::string& GetGuidString() const { return m_HumanReadableName; }
38 
42  std::string GetFilepathReleativeToAssets() const;
43 
44  protected:
45 
47 
48  std::string m_HumanReadableName;
49  };
50 } // namespace Fling
Fling::Guid_Handle GetGuidHandle() const
Get GUID handle (just an int) for this resources guid.
Definition: Resource.h:30
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
Resource(Fling::Guid t_ID)
Definition: Resource.h:16
Base class that represents a loaded resource in the engine.
Definition: Resource.h:11
entt::hashed_string::hash_type Guid_Handle
Definition: FlingTypes.h:27
std::string m_HumanReadableName
Definition: Resource.h:48
Fling::Guid m_Guid
Definition: Resource.h:46
entt::hashed_string Guid
Definition: FlingTypes.h:26
The resource manager handles loading of files off disk.
Definition: ResourceManager.h:23
virtual ~Resource()=default
const std::string & GetGuidString() const
Get the human-readable string representation of this GUID.
Definition: Resource.h:37
Definition: Engine.h:29