diff options
Diffstat (limited to 'stats/ancients.go')
| -rw-r--r-- | stats/ancients.go | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/stats/ancients.go b/stats/ancients.go new file mode 100644 index 0000000..16ea207 --- /dev/null +++ b/stats/ancients.go @@ -0,0 +1,50 @@ +package stats + +import ( + "sts2stats/model" +) + +const ( + AncientKey = "ancient" +) + +type AncientChoice struct { + RunStat + AncientOption + ActIndex int + ActName string + Chosen bool +} + +type AncientOption struct { + Key string + Type string +} + +func EnrichAncients(run model.Run, st RunStat) (opts []any, err error) { + for actIndex, act := range run.MapPointHistory { + for _, floor := range act { + if floor.MapPointType != AncientKey { + continue + } + + for _, stat := range floor.PlayerStats { + for _, choice := range stat.AncientChoice { + + opts = append(opts, &AncientChoice{ + AncientOption: AncientOption{ + Key: choice.TextKey, + Type: choice.Title.Table, + }, + RunStat: st, + ActIndex: actIndex, + ActName: run.Acts[actIndex], + Chosen: choice.WasChosen, + }) + } + } + + } + } + return opts, nil +} |
