From 007e2de369f9fc26da3237646de14f2af5052ee8 Mon Sep 17 00:00:00 2001 From: ewy Date: Fri, 22 May 2026 16:54:49 +0200 Subject: initial commit --- stats/cards.go | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 stats/cards.go (limited to 'stats/cards.go') diff --git a/stats/cards.go b/stats/cards.go new file mode 100644 index 0000000..d4049f4 --- /dev/null +++ b/stats/cards.go @@ -0,0 +1,37 @@ +package stats + +import ( + "sts2stats/model" +) + +type CardChoice struct { + RunStat + model.PlayerStat + RoomStat + Card string + Upgrade int + Picked bool +} + +func EnrichCardChoice(run model.Run, st RunStat) (result []any, err error) { + for ia, act := range run.MapPointHistory { + for i, floor := range act { + for _, stat := range floor.PlayerStats { + for _, choice := range stat.CardChoices { + result = append(result, &CardChoice{ + RunStat: st, + Card: choice.Card.Id, + Upgrade: choice.Card.CurrentUpgradeLevel, + PlayerStat: stat.PlayerStat, + RoomStat: RoomStat{ + Floor: i, + Act: ia + 1, + }, + Picked: false, + }) + } + } + } + } + return +} -- cgit v1.3.1