Skip to main content

✅ All functions copy on write

CategoryAbility
StatusPassing
Testtests/test_turn_sequence.py::test_all_functions_copy_on_write

State-changing functions return new states without mutating the input state.

Preconditions

  • An initial game state

Action

  • Call multiple state-changing functions (march, attack, ability, phase advance)

  • Keep reference to the original state

Expected Postconditions

  • Original state unchanged after each function call

  • Each function returns a new state object

  • Copy-on-write semantics enforced throughout the engine

  • No shared mutable references between old and new states