Move GameState
and UIGameplay
into new subrecord in AppState
#2276
Labels
Z-Refactoring
This issue is about restructuring the code without changing the behaviour to improve code quality.
Currently,
AppState
has a dedicated fieldRuntimeState
for scenario-independent state, and a fieldGameState
for scenario-dependent state. However,UIState
contains an awkward mix of active-play-dependent widget states and play-independent states (see #2265).swarm/src/swarm-tui/Swarm/TUI/Model.hs
Lines 176 to 181 in e7b4d65
When embarking on #2265 I noticed that
GameState
tends to be accessed often alongsideUIGameplay
. I propose a new toplevel memberPlayingState
of theAppState
that shall contain bothGameState
andUIGameplay
. Eventually,PlayingState
should be made nullable.This refactoring may be accomplished in phases:
GameState
underneath a new toplevel recordPlayingState
.UIGameplay
out ofUIState
into a second field ofPlayingState
.PlayingState
field in aMaybe
scenarioRef
mandatory inPlayingState
(scenarioRef should be a non-optional member of UIGameplay #2265)The text was updated successfully, but these errors were encountered: