Skip to content

Architecture

ManApart edited this page Dec 29, 2022 · 2 revisions

App Architecture

Ideas and thoughts around the architecture of the app itself.

Command/Event/Listener model

  • Commands simply parse / understand user input and then create events
  • Commands do not handle or change state
  • Commands should be unknown to game state, events, and logic
  • Commands can do state checks for convenience / clarification, but actual validation (can a player rest) should be done by listeners. If needbe, make the command's event an 'attempt event'
  • All intents and actions are created through events
  • Listeners subscribe to individual events, update gamestate and print to console.
Clone this wiki locally