diff options
| author | historia <[not public]> | 2026-07-07 16:46:32 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-07 16:46:32 -0400 |
| commit | 726997d799edc388cd448e978d5bb0755aaa551c (patch) | |
| tree | b7aa8dc2dc9d2edcad1c0a4012a28d01d348db69 /internal/player/stats.go | |
| parent | ab2597b22ccdb71116992aec78080d9858358d04 (diff) | |
| download | thehouseoficarus-726997d799edc388cd448e978d5bb0755aaa551c.tar.gz | |
feat: bitpacked and base64 encoded VisitedRooms in player YAML to keep the file human readable
Diffstat (limited to 'internal/player/stats.go')
| -rw-r--r-- | internal/player/stats.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/internal/player/stats.go b/internal/player/stats.go index 82b741c..2b63558 100644 --- a/internal/player/stats.go +++ b/internal/player/stats.go @@ -1,17 +1,14 @@ package player type PlayerStats struct { - RoomsVisited map[int]bool `yaml:"rooms_visited,omitempty"` + RoomsVisited RoomSet `yaml:"rooms_visited,omitempty"` MobKills map[string]int `yaml:"mob_kills,omitempty"` TotalKills int `yaml:"total_kills"` Deaths int `yaml:"deaths"` } func (s *PlayerStats) RecordRoomVisit(roomID int) { - if s.RoomsVisited == nil { - s.RoomsVisited = make(map[int]bool) - } - s.RoomsVisited[roomID] = true + s.RoomsVisited.Add(roomID) } func (s *PlayerStats) RecordMobKill(mobDefID string) { |
