summaryrefslogtreecommitdiff
path: root/stats/cards.go
diff options
context:
space:
mode:
Diffstat (limited to 'stats/cards.go')
-rw-r--r--stats/cards.go37
1 files changed, 37 insertions, 0 deletions
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
+}