• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hpi-swa-teaching / TabletopUI / 26471631242

26 May 2026 07:53PM UTC coverage: 73.439% (+1.6%) from 71.824%
26471631242

push

github

IvayloSta
Centralize state schema in TTGameStateKeys and make get/loadState JSON-safe

Introduce TTGameStateKeys in TabletopUI-Core as a class-side vocabulary
holding every state-serialization key as a named accessor. Route all
getState/loadState: methods across the state tree through it instead of
inline symbol literals, and finish the previously half-done loadState
restoration for fight and initiative contexts.

Production
- New TTGameStateKeys class with 17 schema-key accessors
- TTCharacter, TTActionLog, TTToken, TTMap, TTInputField, TTCommandParser,
  TTDefaultContext, TTFightContext, TTInitiativeContext all route
  get/loadState: through TTGameStateKeys instead of inline literals
- TTFightContext>>getState emits keyFightingPlayerNames as an Array of
  String (was emitting raw TTCharacter Morph objects under #fightingPlayers,
  which could not survive JSON serialization)
- TTInitiativeContext>>getState keys the rolls Dictionary by character
  name String instead of raw TTCharacter, for the same JSON-safety reason
- TTCommandParser>>loadState: restores fight order and initiative rolls
  (previously flagged as 'doesn't load real state'); characters are
  reconstructed from names with a default #player role - documented in
  the method's flag as a known follow-up

Tests
- State-related tests now reference TTGameStateKeys; previously commented
  or no-op bodies replaced with real value and round-trip assertions
- TTContextTestBase>>test01GetState renamed to assertContextHasGameStateKey
  (a Custom Assertion per Swt_05 p.59/p.85) so SUnit no longer attempts to
  run an abstract base method that fails with MessageNotUnderstood: #CUT
- TTDefaultContextTest>>test04GetState restored
- TTFightContextTest, TTInitiativeContextTest, TTCharacterTest,
  TTActionLogTest, TTTokenTest, TTMapTest all updated to call the helper
  or assert real values
- TTMapTest>>mapInstantiationDict (115-line literal fixture, Long-Setup
  smell from Swt_05 p.119) removed; the rewritten test... (continued)

96 of 137 new or added lines in 31 files covered. (70.07%)

2 existing lines in 2 files now uncovered.

4305 of 5862 relevant lines covered (73.44%)

2.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/TabletopUI-CommandProcessing.package/TTCommandParser.class/instance/loadState..st


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc