26 lines
580 B
Go
26 lines
580 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"cardSimEngine/cardsim"
|
||
|
)
|
||
|
|
||
|
// SmokeTestCollection is a stats collection for the simple test sim.
|
||
|
type SmokeTestCollection struct {
|
||
|
Number cardsim.Stored[int]
|
||
|
Total cardsim.Stored[int]
|
||
|
Turns cardsim.Invisible[int]
|
||
|
|
||
|
Flavor cardsim.Stored[string]
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|