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:
parent
e30c18fbdf
commit
8defc0bedf
8 changed files with 48 additions and 26 deletions
19
devices.cpp
Normal file
19
devices.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include "devices.hpp"
|
||||
#include "events.hpp"
|
||||
|
||||
namespace components {
|
||||
void StairsDown(DinkyECS::Entity player_ent, json &, DinkyECS::World &world) {
|
||||
world.send<Events::GUI>(Events::GUI::STAIRS, player_ent, {});
|
||||
}
|
||||
|
||||
void StairsUp(DinkyECS::Entity player_ent, json &, DinkyECS::World &world) {
|
||||
|
||||
world.send<Events::GUI>(Events::GUI::STAIRS, player_ent, {});
|
||||
}
|
||||
|
||||
void Device::hit(DinkyECS::Entity ent, DinkyECS::World &world) {
|
||||
for(auto& action : actions) {
|
||||
action(ent, config, world);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue