Quick code review to refresh my memory.
This commit is contained in:
parent
ee9f8c7c4b
commit
517de91a5b
8 changed files with 27 additions and 18 deletions
|
|
@ -21,6 +21,8 @@ namespace boss {
|
|||
FSM_STATE(State, END, ev, data);
|
||||
}
|
||||
|
||||
run_systems();
|
||||
|
||||
return in_state(State::END);
|
||||
}
|
||||
|
||||
|
|
@ -61,9 +63,6 @@ namespace boss {
|
|||
case BOSS_START:
|
||||
state(State::END);
|
||||
break;
|
||||
case TICK:
|
||||
run_systems();
|
||||
break;
|
||||
case ATTACK:
|
||||
$ui.status(L"PLAYER TURN");
|
||||
state(State::PLAYER_TURN);
|
||||
|
|
@ -83,6 +82,7 @@ namespace boss {
|
|||
break;
|
||||
case ATTACK: {
|
||||
$ui.status(L"PLAYER TURN");
|
||||
$ui.move_player(run % 10 < 5 ? "player1" : "player2");
|
||||
int attack_id = std::any_cast<int>(data);
|
||||
boss::System::combat(attack_id);
|
||||
state(State::PLAYER_TURN);
|
||||
|
|
@ -103,6 +103,7 @@ namespace boss {
|
|||
break;
|
||||
case ATTACK: {
|
||||
$ui.status(L"BOSS TURN");
|
||||
$ui.move_boss(run % 10 < 5 ? "boss1" : "boss3");
|
||||
int attack_id = std::any_cast<int>(data);
|
||||
boss::System::combat(attack_id);
|
||||
state(State::BOSS_TURN);
|
||||
|
|
@ -120,6 +121,10 @@ namespace boss {
|
|||
}
|
||||
|
||||
void Fight::run_systems() {
|
||||
run++;
|
||||
}
|
||||
|
||||
void Fight::render(sf::RenderWindow& window) {
|
||||
$ui.render(window);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue