migrant input: ja guarda i llig configuracions de gamepad en fitxer
This commit is contained in:
@@ -26,10 +26,12 @@ struct GamepadConfig {
|
||||
}
|
||||
};
|
||||
|
||||
using GamepadConfigs = std::vector<GamepadConfig>;
|
||||
|
||||
class GamepadConfigManager {
|
||||
public:
|
||||
// Escribir vector de GamepadConfig a archivo JSON
|
||||
static bool writeToJson(const std::vector<GamepadConfig>& configs, const std::string& filename) {
|
||||
static bool writeToJson(const GamepadConfigs& configs, const std::string& filename) {
|
||||
try {
|
||||
nlohmann::json j;
|
||||
j["gamepads"] = nlohmann::json::array();
|
||||
@@ -69,7 +71,7 @@ class GamepadConfigManager {
|
||||
}
|
||||
|
||||
// Leer vector de GamepadConfig desde archivo JSON
|
||||
static bool readFromJson(std::vector<GamepadConfig>& configs, const std::string& filename) {
|
||||
static bool readFromJson(GamepadConfigs& configs, const std::string& filename) {
|
||||
try {
|
||||
std::ifstream file(filename);
|
||||
if (!file.is_open()) {
|
||||
|
||||
Reference in New Issue
Block a user