More refactoring to get the GUI dumber.
This commit is contained in:
parent
2fdbd63f4c
commit
009b1e63a7
6 changed files with 86 additions and 75 deletions
10
systems.cpp
10
systems.cpp
|
@ -98,21 +98,21 @@ void System::combat(DinkyECS::World &world, Player &player) {
|
|||
int player_dmg = player_combat.attack(enemy_combat);
|
||||
|
||||
if(player_dmg > 0) {
|
||||
world.send<GUIEvent>(GUIEvent::HIT, entity);
|
||||
world.send<Events::GUI>(Events::GUI::HIT, entity);
|
||||
} else {
|
||||
world.send<GUIEvent>(GUIEvent::MISS, entity);
|
||||
world.send<Events::GUI>(Events::GUI::MISS, entity);
|
||||
}
|
||||
|
||||
if(enemy_combat.hp > 0) {
|
||||
int enemy_dmg = enemy_combat.attack(player_combat);
|
||||
|
||||
if(enemy_dmg > 0) {
|
||||
world.send<GUIEvent>(GUIEvent::HIT, player.entity);
|
||||
world.send<Events::GUI>(Events::GUI::HIT, player.entity);
|
||||
} else {
|
||||
world.send<GUIEvent>(GUIEvent::MISS, player.entity);
|
||||
world.send<Events::GUI>(Events::GUI::MISS, player.entity);
|
||||
}
|
||||
} else {
|
||||
world.send<GUIEvent>(GUIEvent::DEAD, entity);
|
||||
world.send<Events::GUI>(Events::GUI::DEAD, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue