Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
AssetManager.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** Air-Trap
4** File description:
5** AssetManager
6*/
7
8#pragma once
9
10#include <SFML/Graphics.hpp>
11#include <string>
12#include <unordered_map>
13
14namespace rtp::client {
22 public:
23 AssetManager() = default;
24 ~AssetManager() = default;
25
26 void loadTexture(const std::string& id, const std::string& filePath);
27 void loadFont(const std::string& id, const std::string& filePath);
28
29 sf::Texture& getTexture(const std::string& id);
30 sf::Font& getFont(const std::string& id);
31
32 private:
33 std::unordered_map<std::string, sf::Texture> _textures;
34 std::unordered_map<std::string, sf::Font> _fonts;
35 };
36} // namespace Client::Graphics
Manages loading and storage of graphical assets.
sf::Texture & getTexture(const std::string &id)
std::unordered_map< std::string, sf::Font > _fonts
void loadFont(const std::string &id, const std::string &filePath)
std::unordered_map< std::string, sf::Texture > _textures
void loadTexture(const std::string &id, const std::string &filePath)
sf::Font & getFont(const std::string &id)
R-Type client namespace.