Goals persist as a player attachment: load on join, write after each change, unload on leave so worlds do not leak. Dying does not wipe the list. Remote dedicated servers stay RAM-only.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# 💾 Persistence
|
||||
|
||||
Port used by [[▶️ Create Goal]] (and the sibling quantity / clear paths).
|
||||
|
||||
The domain does not know where the plan is stored (ADR-004). Infrastructure answers.
|
||||
|
||||
---
|
||||
|
||||
## Shape
|
||||
|
||||
```text
|
||||
GoalStore
|
||||
all() / find / put / remove / clear
|
||||
```
|
||||
|
||||
Play uses `PersistingGoalStore`: RAM plus a write after each change.
|
||||
|
||||
`InMemoryGoalStore` remains for unit tests.
|
||||
|
||||
---
|
||||
|
||||
## Shipped implementation
|
||||
|
||||
Player attachment in **this world's save** (ADR-017).
|
||||
|
||||
| Event | Result |
|
||||
|-------|--------|
|
||||
| Join world | Load this player's goals |
|
||||
| Create / + / − / Clear | Write the attachment |
|
||||
| Leave world | Unload RAM. Do not write empty (that would wipe the save) |
|
||||
| Death | Plan is copied. It is not loot |
|
||||
|
||||
Singleplayer and LAN host. Remote dedicated server: RAM-only this slice.
|
||||
|
||||
Server save and cloud remain possible later. They do not change `GoalStore`.
|
||||
|
||||
---
|
||||
|
||||
## Related Documents
|
||||
|
||||
[[🏛️ Architecture]]
|
||||
|
||||
[[📦 Packages]]
|
||||
|
||||
[[📝 Decisions]]
|
||||
|
||||
[[▶️ Create Goal]]
|
||||
|
||||
[[🎯 Goal]]
|
||||
Reference in New Issue
Block a user