/** * Copyright (c) 2024 Dominic Masters * * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ #include "assert/assert.h" #include "battle.h" #include "util/memory.h" #include "game/game.h" #include "ui/textbox.h" battle_t BATTLE; void battleInit() { memorySet(&BATTLE, 0, sizeof(battle_t)); } void battleStart() { GAME.state = GAME_STATE_BATTLE; BATTLE.state = BATTLE_STATE_INITIAL; textboxSetText(NULL, "battle.start"); } void battleUpdate() { switch(BATTLE.state) { case BATTLE_STATE_INITIAL: if(textboxIsOpen()) return; break; default: assertUnreachable("Unknown battle state."); break; } }