[Added] Headerfiles

This commit is contained in:
Ninjaws
2024-12-07 00:28:25 +01:00
parent 5d2251c0f4
commit 8d1c3bc429
61 changed files with 270 additions and 1 deletions
+52
View File
@@ -0,0 +1,52 @@
#ifndef ASSET_SERVICE_H
#define ASSET_SERVICE_H
#include <vector>
#include <string>
#include "raylib.h"
class AssetService
{
private:
AssetService() {
setAssets();
};
~AssetService() = default;
std::string assetDir;
std::vector<Font> fonts;
std::vector<Sound> sounds;
std::vector<Music> music;
public:
AssetService(const AssetService&) = delete;
AssetService& operator=(const AssetService&) = delete;
static AssetService& getInstance() {
static AssetService instance;
return instance;
}
std::vector<Font> getFonts() {
return fonts;
}
std::vector<Sound> getSounds() {
return sounds;
}
std::vector<Music> getMusic() {
return music;
}
void setAssets();
Font loadFont(std::string filename, int fontSize);
Font loadFont(std::string filename);
Music loadMusic(std::string filename, bool loops);
Sound loadSound(std::string filename);
void setAssetDir(std::string assetDir);
};
#endif