From 726997d799edc388cd448e978d5bb0755aaa551c Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 7 Jul 2026 16:46:32 -0400 Subject: feat: bitpacked and base64 encoded VisitedRooms in player YAML to keep the file human readable --- internal/player/stats.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'internal/player/stats.go') 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) { -- cgit v1.2.3