Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
rtp::config Namespace Reference

File : SpriteMapConfig.hpp License: MIT Author : GitHub Copilot Date : 18/01/2026. More...

Classes

class  SimpleJson
 

Functions

std::unordered_map< std::string, SimpleJsonparseWeaponsFile (const std::string &filepath="config/common/weapons.json")
 
std::unordered_map< std::string, std::string > loadSpriteMappings (const std::string &filepath="config/client/sprite_mappings.json")
 Load sprite mappings from a JSON file.
 
bool saveSpriteMappings (const std::unordered_map< std::string, std::string > &mappings, const std::string &filepath="config/client/sprite_mappings.json")
 Save sprite mappings to a JSON file.
 
std::unordered_map< rtp::ecs::components::WeaponKind, rtp::ecs::components::SimpleWeaponloadWeaponConfigs (const std::string &path="config/common/weapons.json")
 
std::unordered_map< rtp::ecs::components::WeaponKind, rtp::ecs::components::SimpleWeapon > & weapon_cache ()
 
bool & weapon_cache_loaded ()
 
void reloadWeaponConfigs ()
 
const rtp::ecs::components::SimpleWeapongetWeaponDef (rtp::ecs::components::WeaponKind kind)
 
bool hasWeaponConfigs ()
 
std::string getWeaponDisplayName (rtp::ecs::components::WeaponKind kind)
 

Detailed Description

File : SpriteMapConfig.hpp License: MIT Author : GitHub Copilot Date : 18/01/2026.

Configuration loader for sprite mappings (mod system)

Function Documentation

◆ getWeaponDef()

◆ getWeaponDisplayName()

◆ hasWeaponConfigs()

◆ loadSpriteMappings()

std::unordered_map< std::string, std::string > rtp::config::loadSpriteMappings ( const std::string &  filepath = "config/client/sprite_mappings.json")
inline

Load sprite mappings from a JSON file.

Parameters
filepathPath to sprite_mappings.json (default: config/client/sprite_mappings.json)
Returns
Map of entity keys to sprite paths

Definition at line 26 of file SpriteMapConfig.hpp.

References rtp::config::SimpleJson::getData(), and rtp::config::SimpleJson::parseContent().

Referenced by rtp::client::SpriteCustomizer::loadMappings(), and rtp::client::scenes::ModMenuScene::loadSpriteMappings().

◆ loadWeaponConfigs()

◆ parseWeaponsFile()

std::unordered_map< std::string, SimpleJson > rtp::config::parseWeaponsFile ( const std::string &  filepath = "config/common/weapons.json")
inline

◆ reloadWeaponConfigs()

void rtp::config::reloadWeaponConfigs ( )
inline

◆ saveSpriteMappings()

bool rtp::config::saveSpriteMappings ( const std::unordered_map< std::string, std::string > &  mappings,
const std::string &  filepath = "config/client/sprite_mappings.json" 
)
inline

Save sprite mappings to a JSON file.

Parameters
mappingsMap of entity keys to sprite paths
filepathPath to sprite_mappings.json (default: config/client/sprite_mappings.json)
Returns
true if saved successfully, false otherwise

Definition at line 54 of file SpriteMapConfig.hpp.

Referenced by rtp::client::scenes::ModMenuScene::saveSpriteMappings().

◆ weapon_cache()

std::unordered_map< rtp::ecs::components::WeaponKind, rtp::ecs::components::SimpleWeapon > & rtp::config::weapon_cache ( )
inline

Definition at line 76 of file WeaponConfig.hpp.

Referenced by getWeaponDef(), hasWeaponConfigs(), and reloadWeaponConfigs().

◆ weapon_cache_loaded()

bool & rtp::config::weapon_cache_loaded ( )
inline

Definition at line 82 of file WeaponConfig.hpp.

Referenced by getWeaponDef(), hasWeaponConfigs(), and reloadWeaponConfigs().