38 lines
671 B
C++
38 lines
671 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);
|
|
const Shop* getShopById(uint16_t id);
|
|
const std::unordered_map<uint16_t, Shop>& getAllShops();
|
|
|
|
} // namespace cursebreaker
|