#pragma once #include #include #include #include #include "GeneralUtils.h" class GameConfig { public: static void Load(const std::string& filepath); static const std::string& GetValue(const std::string& key); static void SetValue(const std::string& key, const std::string& value); template static T GetValue(const std::string& key) { T value; if (GeneralUtils::TryParse(GetValue(key), value)) { return value; } return T(); } template static void SetValue(const std::string& key, const T& value) { SetValue(key, std::to_string(value)); } private: static void ProcessLine(const std::string& line); static std::map m_Config; static std::string m_EmptyString; };