// // Created by beerpsi on 4/14/2024. // #include #include #include "io.h" #include "chuni/io.h" #include "chusan/io.h" #include "mai2/io.h" #include "mercury/io.h" #include "mu3/io.h" namespace games { static bool IO_INITIALIZED = false; static std::vector games; static std::unordered_map hw_family; static std::unordered_map> buttons; static std::unordered_map> file_hints; static void initialize() { if (IO_INITIALIZED) { return; } const std::string chuni("CHUNITHM"); games.push_back(chuni); hw_family.insert({ chuni, HW_FAMILY_AMEX }); buttons.insert({ chuni, chuni::get_buttons() }); file_hints[chuni].emplace_back("chuniApp.exe"); const std::string chusan("CHUNITHM NEW!!"); games.push_back(chusan); hw_family.insert({ chusan, HW_FAMILY_ALLS }); buttons.insert({ chusan, chusan::get_buttons() }); file_hints[chusan].emplace_back("chusanApp.exe"); const std::string mai2("maimai DX"); games.push_back(mai2); hw_family.insert({ mai2, HW_FAMILY_ALLS }); buttons.insert({ mai2, mai2::get_buttons() }); file_hints[mai2].emplace_back("Sinmai.exe"); const std::string mu3("O.N.G.E.K.I."); games.push_back(mu3); hw_family.insert({ mu3, HW_FAMILY_ALLS }); buttons.insert({ mu3, mu3::get_buttons() }); file_hints[mu3].emplace_back("mu3.exe"); const std::string mercury("WACCA"); games.push_back(mercury); hw_family.insert({ mercury, HW_FAMILY_ALLS }); buttons.insert({ mercury, mercury::get_buttons() }); file_hints[mercury].emplace_back("../WindowsNoEditor/Mercury/Binaries/Win64/Mercury-Win64-Shipping.exe"); IO_INITIALIZED = true; } const std::vector &get_games() { initialize(); return games; } HWFamily get_hw_family(const std::string &game) { initialize(); auto it = hw_family.find(game); if (it == hw_family.end()) { return HW_FAMILY_UNKNOWN; } return it->second; } std::vector