imgration 14/12/2025

This commit is contained in:
2025-12-24 16:51:01 +09:00
parent 121eb8eb25
commit d8a8d9633d
46 changed files with 1866 additions and 1026 deletions

View File

@@ -34,8 +34,8 @@ struct Achievement
};
// Achievements configuration functions
bool loadAchievementsFromXML(const std::string& filepath);
const Achievement* getAchievementById(uint16_t id);
const std::unordered_map<uint16_t, Achievement>& getAllAchievements();
bool loadAchievementsFromXML(const std::string& filepath, std::unordered_map<uint16_t, Achievement>& achievements);
const Achievement* getAchievementById(uint16_t id, const std::unordered_map<uint16_t, Achievement>& achievements);
const std::unordered_map<uint16_t, Achievement>& getAllAchievements(const std::unordered_map<uint16_t, Achievement>& achievements);
} // namespace cursebreaker

View File

@@ -34,8 +34,8 @@ struct Harvestable
};
// Harvestables configuration functions
bool loadHarvestablesFromXML(const std::string& filepath);
const Harvestable* getHarvestableById(uint16_t id);
const std::unordered_map<uint16_t, Harvestable>& getAllHarvestables();
bool loadHarvestablesFromXML(const std::string& filepath, std::unordered_map<uint16_t, Harvestable>& harvestables);
const Harvestable* getHarvestableById(uint16_t id, const std::unordered_map<uint16_t, Harvestable>& harvestables);
const std::unordered_map<uint16_t, Harvestable>& getAllHarvestables(const std::unordered_map<uint16_t, Harvestable>& harvestables);
} // namespace cursebreaker

29
include/configs/helpers.h Normal file
View File

@@ -0,0 +1,29 @@
#pragma once
#include <string>
#include <unordered_map>
#include "configs/constants.h"
namespace cursebreaker {
// Helper functions for enum conversions
StatType stringToStatType(const std::string& str);
ItemCategory stringToItemCategory(const std::string& str);
ItemType stringToItemType(const std::string& str);
Tool stringToTool(const std::string& str);
SkillType stringToSkillType(const std::string& str);
WorkbenchType stringToWorkbenchType(const std::string& str);
GenstatType stringToGenstatType(const std::string& str);
ActionType stringToActionType(const std::string& str);
std::string statTypeToString(StatType type);
std::string itemCategoryToString(ItemCategory category);
std::string itemTypeToString(ItemType type);
std::string toolToString(Tool tool);
std::string skillTypeToString(SkillType skill);
std::string workbenchTypeToString(WorkbenchType workbench);
std::string genstatTypeToString(GenstatType genstat);
std::string actionTypeToString(ActionType action);
} // namespace cursebreaker

View File

@@ -63,8 +63,8 @@ struct Item {
};
// Items configuration functions
bool loadItemsFromXML(const std::string& filepath);
const Item* getItemById(uint16_t id);
const std::unordered_map<uint16_t, Item>& getAllItems();
bool loadItemsFromXML(const std::string& filepath, std::unordered_map<uint16_t, Item>& items);
const Item* getItemById(uint16_t id, const std::unordered_map<uint16_t, Item>& items);
const std::unordered_map<uint16_t, Item>& getAllItems(const std::unordered_map<uint16_t, Item>& items);
} // namespace cursebreaker

View File

@@ -31,8 +31,8 @@ struct LootTable
};
// Loot configuration functions
bool loadLootTablesFromXML(const std::string& filepath);
const LootTable* getLootTableById(uint16_t id);
const std::unordered_map<uint16_t, LootTable>& getAllLootTables();
bool loadLootTablesFromXML(const std::string& filepath, std::unordered_map<uint16_t, LootTable>& lootTables);
const LootTable* getLootTableById(uint16_t id, const std::unordered_map<uint16_t, LootTable>& lootTables);
const std::unordered_map<uint16_t, LootTable>& getAllLootTables(const std::unordered_map<uint16_t, LootTable>& lootTables);
} // namespace cursebreaker

View File

@@ -36,8 +36,8 @@ struct NPC
};
// NPCs configuration functions
bool loadNPCsFromXML(const std::string& filepath);
const NPC* getNPCById(uint16_t id);
const std::unordered_map<uint16_t, NPC>& getAllNPCs();
bool loadNPCsFromXML(const std::string& filepath, std::unordered_map<uint16_t, NPC>& npcs);
const NPC* getNPCById(uint16_t id, const std::unordered_map<uint16_t, NPC>& npcs);
const std::unordered_map<uint16_t, NPC>& getAllNPCs(const std::unordered_map<uint16_t, NPC>& npcs);
} // namespace cursebreaker

View File

@@ -31,8 +31,8 @@ struct Shop
};
// Shops configuration functions
bool loadShopsFromXML(const std::string& filepath);
const Shop* getShopById(uint16_t id);
const std::unordered_map<uint16_t, Shop>& getAllShops();
bool loadShopsFromXML(const std::string& filepath, std::unordered_map<uint16_t, Shop>& shops);
const Shop* getShopById(uint16_t id, const std::unordered_map<uint16_t, Shop>& shops);
const std::unordered_map<uint16_t, Shop>& getAllShops(const std::unordered_map<uint16_t, Shop>& shops);
} // namespace cursebreaker