Skip to content

Add Player and Party value types#18

Merged
gwillish merged 1 commit intomainfrom
add-player-party-types
Apr 4, 2026
Merged

Add Player and Party value types#18
gwillish merged 1 commit intomainfrom
add-player-party-types

Conversation

@gwillish
Copy link
Copy Markdown
Owner

@gwillish gwillish commented Apr 4, 2026

Summary

  • Adds Player — a persistent GM record of a player character, with the same stat shape as PlayerConfig plus an asConfig() convenience that snapshots it into an EncounterDefinition
  • Adds Party — a named, ordered group of player IDs; resolving Player objects from IDs is the store's responsibility

Both types live in DHModels (Linux-safe, Foundation-only) and carry Codable, Sendable, Equatable, Hashable, Identifiable conformances. Player fields are var so records can be edited over time.

Closes #14, closes #15

Test plan

  • swift build --target DHModels passes
  • swift test --filter DHModelsTests — 70 tests pass (7 new: PlayerTests × 3, PartyTests × 4)
  • ./Scripts/format.sh exits clean
  • Linux CI passes

@gwillish gwillish merged commit 85a7cb2 into main Apr 4, 2026
2 checks passed
@gwillish gwillish deleted the add-player-party-types branch April 4, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Party value type Add Player value type

1 participant