Files
cursebreaker-parser/include/configs/shops.h
2025-12-24 16:51:01 +09:00

38 lines
810 B
C++

#pragma once
#include <string>
#include <vector>
#include <unordered_map>
#include <tinyxml2.h>
#include "constants.h"
namespace cursebreaker {
struct ShopItem
{
uint16_t itemId{};
uint16_t price{};
uint16_t stock{}; // -1 for unlimited
uint16_t levelRequired{};
};
struct Shop
{
uint16_t id{};
std::string name;
std::string description;
std::string location;
std::vector<ShopItem> inventory;
Shop() = default;
};
// Shops configuration functions
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