Have a plan for the new inventory and looting system, now have to implement it. Temporarily you can't pick anything up, but it will go away.

This commit is contained in:
Zed A. Shaw 2025-06-02 00:58:16 -04:00
parent b8d2d1870d
commit ab391aaa97
9 changed files with 23 additions and 261 deletions

View file

@ -1,35 +0,0 @@
#pragma once
#include "components.hpp"
#include <nlohmann/json.hpp>
#include "levelmanager.hpp"
namespace components {
using namespace nlohmann;
struct InventoryItem {
int count;
json data;
};
struct Inventory {
int gold=0;
LightSource light{0, 0};
std::vector<InventoryItem> items{};
size_t count() { return items.size(); }
void add(InventoryItem item);
bool decrease(size_t at, int count);
bool has_item(size_t at);
InventoryItem& get(size_t at);
int item_index(std::string id);
void erase_item(size_t at);
std::pair<bool, std::string> use(GameLevel &level, size_t at);
};
}