Fixed up the idea for having dynamic callbacks on devices. Might become the new way to do stuff but not sure.
This commit is contained in:
parent
d2162910f6
commit
e30c18fbdf
6 changed files with 74 additions and 39 deletions
|
@ -217,8 +217,6 @@ void System::pickup(DinkyECS::World &world, DinkyECS::Entity actor, DinkyECS::En
|
|||
|
||||
void System::device(DinkyECS::World &world, DinkyECS::Entity actor, DinkyECS::Entity item) {
|
||||
auto& device = world.get<Device>(item);
|
||||
if(device.active) {
|
||||
println("entity {} INTERACTED WITH DEVICE {}", actor, item);
|
||||
device.active = false;
|
||||
}
|
||||
println("entity {} INTERACTED WITH DEVICE {}", actor, item);
|
||||
device.hit(world);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue