Loading logic moved to Asset classes

This commit is contained in:
Dynamitos
2020-06-08 01:44:47 +02:00
parent 356e6058fe
commit ab4a3b5e23
50 changed files with 966 additions and 558 deletions
+6 -4
View File
@@ -13,12 +13,12 @@ public:
Ready
};
Asset();
Asset(const std::filesystem::path& path);
Asset(const std::string& directory, const std::string& name);
Asset(const std::string& fullPath);
Asset(const std::filesystem::path& path);
virtual ~Asset();
std::ifstream& getReadStream();
std::ofstream& getWriteStream();
virtual void save() = 0;
virtual void load() = 0;
// returns the name of the file, without extension
std::string getFileName();
@@ -38,6 +38,8 @@ public:
}
protected:
std::mutex lock;
std::ifstream& getReadStream();
std::ofstream& getWriteStream();
private:
Status status;
std::filesystem::path fullPath;