Chira Engine
A customizable MIT-licensed game engine.
IResourceProvider.h
1 #pragma once
2 
3 #include <string>
4 #include <string_view>
5 
6 namespace chira {
7 
8 class Resource;
9 
11 public:
12  explicit IResourceProvider(std::string name) : providerName(std::move(name)) {}
13  virtual ~IResourceProvider() = default;
14  [[nodiscard]] std::string_view getName() const {
15  return this->providerName;
16  }
17  [[nodiscard]] virtual bool hasResource(std::string_view name) const = 0;
18  virtual void compileResource(std::string_view name, Resource* resource) const = 0;
19 protected:
20  std::string providerName;
21 };
22 
23 } // namespace chira
A chunk of data, usually a file. Is typically cached and shared.
Definition: Resource.h:19