Brought over a bunch of code from the roguelike and now will use it to generate a random map.

This commit is contained in:
Zed A. Shaw 2025-01-30 11:38:57 -05:00
parent 8d3d3b4ec3
commit 2daa1c9bd5
59 changed files with 4303 additions and 411 deletions

33
inventory.hpp Normal file
View file

@ -0,0 +1,33 @@
#pragma once
#include "lights.hpp"
#include <nlohmann/json.hpp>
#include <fmt/core.h>
namespace components {
using namespace nlohmann;
using lighting::LightSource;
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);
InventoryItem& get(size_t at);
int item_index(std::string id);
void erase_item(size_t at);
};
}