Initial idea for the interactive devices thing but I kind of hate it. Going to try another idea that will be simpler.

This commit is contained in:
Zed A. Shaw 2025-01-16 14:33:07 -05:00
parent e30c18fbdf
commit 8defc0bedf
8 changed files with 48 additions and 26 deletions

View file

@ -1,27 +1,12 @@
#pragma once
#include "dinkyecs.hpp"
#include "devices.hpp"
#include "combat.hpp"
#include "inventory.hpp"
#include "tser.hpp"
#include "config.hpp"
namespace components {
typedef std::function<void(json &config, DinkyECS::World &world)> Action;
struct Device {
json config;
std::vector<Action> actions;
void hit(DinkyECS::World &world) {
for(auto& action : actions) {
action(config, world);
}
}
};
void StairsDown(json &data, DinkyECS::World &world);
void StairsUp(json &data, DinkyECS::World &world);
void DummyDeviceAction(json &data, DinkyECS::World &world);
struct Player {
DinkyECS::Entity entity;