2023-04-03 02:01:40 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-04-03 05:25:12 +00:00
|
|
|
"git.chromaticdragon.app/kistaro/CardSimEngine/cardsim"
|
2023-04-03 02:01:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// SmokeTestCollection is a stats collection for the simple test sim.
|
|
|
|
type SmokeTestCollection struct {
|
|
|
|
Number cardsim.Stored[int]
|
2023-04-03 02:02:43 +00:00
|
|
|
Total cardsim.Stored[int64]
|
2023-04-03 02:01:40 +00:00
|
|
|
Turns cardsim.Invisible[int]
|
|
|
|
|
|
|
|
Flavor cardsim.Stored[string]
|
2023-04-04 18:12:07 +00:00
|
|
|
|
2023-04-04 19:14:04 +00:00
|
|
|
Things int `cardsim:"stat" cardsim_name:"A Renamed Thing"`
|
2023-04-04 18:12:07 +00:00
|
|
|
MoreThings int `cardsim:"hidden"`
|
|
|
|
FloatyThings float64 `cardsim:"round1"`
|
2023-04-04 18:37:02 +00:00
|
|
|
Label string `cardsim:"stat"`
|
2023-04-03 02:01:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *SmokeTestCollection) Average() float64 {
|
|
|
|
return float64(c.Total.Value) / float64(c.Turns.Value)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *SmokeTestCollection) Stats() []cardsim.Stat {
|
|
|
|
stats := cardsim.ExtractStats(c)
|
|
|
|
stats = append(stats, cardsim.StatFunc("Average", c.Average))
|
|
|
|
cardsim.SortStats(stats)
|
|
|
|
return stats
|
|
|
|
}
|
2023-04-04 18:12:07 +00:00
|
|
|
|
|
|
|
func (c *SmokeTestCollection) StatTotalThings() float64 {
|
|
|
|
return float64(c.Things+c.MoreThings) + c.FloatyThings
|
|
|
|
}
|