stats2

package
v0.13.439 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetWinRange added in v0.13.330

func SetWinRange(winRange []int)

Types

type Cache added in v0.13.99

type Cache struct {
	MapStats  map[string]*Feature
	Bet       int
	TotalWin  int64
	RespinArr []string
	// contains filtered or unexported fields
}

func NewCache added in v0.13.99

func NewCache(bet int) *Cache

func (*Cache) AddFeature added in v0.13.99

func (s2 *Cache) AddFeature(name string, feature *Feature, isRespin bool)

func (*Cache) GetFeature added in v0.13.99

func (s2 *Cache) GetFeature(name string) *Feature

func (*Cache) HasFeature added in v0.13.99

func (s2 *Cache) HasFeature(name string) bool

func (*Cache) OnStepEnd added in v0.13.320

func (s2 *Cache) OnStepEnd(respinArr []string)

func (*Cache) ProcStatsForeachTrigger added in v0.13.115

func (s2 *Cache) ProcStatsForeachTrigger(name string, runtimes int, wins int64)

func (*Cache) ProcStatsIntVal added in v0.13.334

func (s2 *Cache) ProcStatsIntVal(name string, val int)

func (*Cache) ProcStatsOnEnding added in v0.13.115

func (s2 *Cache) ProcStatsOnEnding(win int64, rngs []int)

func (*Cache) ProcStatsRespinTrigger added in v0.13.318

func (s2 *Cache) ProcStatsRespinTrigger(name string, wins int64, isEnding bool)

func (*Cache) ProcStatsStrVal added in v0.13.407

func (s2 *Cache) ProcStatsStrVal(name string, val string)

func (*Cache) ProcStatsTrigger added in v0.13.99

func (s2 *Cache) ProcStatsTrigger(name string)

func (*Cache) ProcStatsWins added in v0.13.99

func (s2 *Cache) ProcStatsWins(name string, win int64)

type Feature

type Feature struct {
	Parent      string            `json:"parent"`
	RootTrigger *StatsRootTrigger `json:"rootTrigger"` // 只有respin和foreach才需要这个
	Trigger     *StatsTrigger     `json:"trigger"`     // 普通的trigger,如果在respin或foreach下面,则需要配合它们才能得到正确的统计
	Wins        *StatsWins        `json:"wins"`        // wins
	IntVal      *StatsIntVal      `json:"intVal"`      // intVal
	StrVal      *StatsStrVal      `json:"strVal"`      // strVal
}

func NewFeature

func NewFeature(parent string, opts Options) *Feature

func (*Feature) Merge

func (f2 *Feature) Merge(src *Feature)

func (*Feature) SaveSheet

func (f2 *Feature) SaveSheet(f *excelize.File, sheet string, s2 *Stats)

type Option

type Option int
const (
	OptWins        Option = 1
	OptSymbolWins  Option = 2
	OptRootTrigger Option = 3
	OptIntVal      Option = 4
	OptStrVal      Option = 5
)

type Options

type Options []Option

func (Options) Has

func (opts Options) Has(opt Option) bool

type Stats

type Stats struct {
	MapStats map[string]*Feature `json:"mapStats"`

	TotalBet       int64            `json:"totalBet"`
	TotalWins      int64            `json:"totalWins"`
	BetTimes       int64            `json:"betTimes"`
	MaxWins        int64            `json:"maxWins"`
	MaxWinTimes    int64            `json:"maxWinTimes"`
	MaxWinRNGs     []int            `json:"maxWinRNGs"`
	BetEndingTimes int64            `json:"-"`
	Components     []string         `json:"components"`
	Wins           *StatsWins       `json:"wins"`
	MapRNGs        map[string][]int `json:"rngs"`
	// contains filtered or unexported fields
}

func LoadStats added in v0.13.105

func LoadStats(str string) (*Stats, error)

func NewStats

func NewStats(components []string) *Stats

func (*Stats) AddFeature

func (s2 *Stats) AddFeature(name string, feature *Feature)

func (*Stats) ExportExcel added in v0.13.107

func (s2 *Stats) ExportExcel() ([]byte, error)

func (*Stats) GetRunTimes added in v0.13.99

func (s2 *Stats) GetRunTimes(name string) int64

func (*Stats) Merge added in v0.13.105

func (s2 *Stats) Merge(src *Stats)

func (*Stats) PushBet

func (s2 *Stats) PushBet(bet int)

func (*Stats) PushCache added in v0.13.99

func (s2 *Stats) PushCache(cache *Cache)

func (*Stats) PushRNGs added in v0.13.433

func (s2 *Stats) PushRNGs(name string, rngs []int)

func (*Stats) SaveExcel

func (s2 *Stats) SaveExcel(fn string) error

func (*Stats) Start

func (s2 *Stats) Start()

func (*Stats) ToJson added in v0.13.105

func (s2 *Stats) ToJson() string

func (*Stats) WaitEnding

func (s2 *Stats) WaitEnding()

type StatsIntVal added in v0.13.334

type StatsIntVal struct {
	TotalUsedTimes int64         `json:"totalUsedTimes"`
	MapUsedTimes   map[int]int64 `json:"mapUsedTimes"`
}

func NewStatsIntVal added in v0.13.334

func NewStatsIntVal() *StatsIntVal

func (*StatsIntVal) Merge added in v0.13.334

func (intVal *StatsIntVal) Merge(src *StatsIntVal)

func (*StatsIntVal) SaveSheet added in v0.13.334

func (intVal *StatsIntVal) SaveSheet(f *excelize.File, sheet string, s2 *Stats)

func (*StatsIntVal) UseVal added in v0.13.334

func (intVal *StatsIntVal) UseVal(val int)

type StatsRootTrigger added in v0.13.99

type StatsRootTrigger struct {
	RunTimes     int64      `json:"runTimes"`
	TriggerTimes int64      `json:"triggerTimes"`
	TotalWins    int64      `json:"totalWins"`
	Wins         *StatsWins `json:"wins"`
	CurWins      int64      `json:"-"`
	IsStarted    bool       `json:"-"`
}

func NewStatsRootTrigger added in v0.13.103

func NewStatsRootTrigger() *StatsRootTrigger

func (*StatsRootTrigger) Merge added in v0.13.99

func (trigger *StatsRootTrigger) Merge(src *StatsRootTrigger)

func (*StatsRootTrigger) SaveSheet added in v0.13.99

func (trigger *StatsRootTrigger) SaveSheet(f *excelize.File, sheet string, parent string, s2 *Stats)

type StatsStrVal added in v0.13.407

type StatsStrVal struct {
	TotalUsedTimes int64            `json:"totalUsedTimes"`
	MapUsedTimes   map[string]int64 `json:"mapUsedTimes"`
}

func NewStatsStrVal added in v0.13.407

func NewStatsStrVal() *StatsStrVal

func (*StatsStrVal) Merge added in v0.13.407

func (strVal *StatsStrVal) Merge(src *StatsStrVal)

func (*StatsStrVal) SaveSheet added in v0.13.407

func (strVal *StatsStrVal) SaveSheet(f *excelize.File, sheet string, s2 *Stats)

func (*StatsStrVal) UseVal added in v0.13.407

func (strVal *StatsStrVal) UseVal(val string)

type StatsTrigger

type StatsTrigger struct {
	TriggerTimes int64 `json:"triggerTimes"`
}

func NewStatsTrigger added in v0.13.103

func NewStatsTrigger() *StatsTrigger

func (*StatsTrigger) Merge

func (trigger *StatsTrigger) Merge(src *StatsTrigger)

func (*StatsTrigger) SaveSheet

func (trigger *StatsTrigger) SaveSheet(f *excelize.File, sheet string, parent string, s2 *Stats)

type StatsWins

type StatsWins struct {
	TotalWin      int64            `json:"totalWin"`
	MapWinTimes   map[int]int64    `json:"mapWinTimes"`
	MapWinTimesEx map[string]int64 `json:"MapWinTimesEx"`
	MapWinEx      map[string]int64 `json:"MapWinEx"`
	SD            float64
}

func NewStatsWins added in v0.13.103

func NewStatsWins() *StatsWins

func (*StatsWins) AddWin added in v0.13.103

func (wins *StatsWins) AddWin(win int64)

func (*StatsWins) Merge

func (wins *StatsWins) Merge(src *StatsWins)

func (*StatsWins) SaveSheet

func (wins *StatsWins) SaveSheet(f *excelize.File, sheet string, s2 *Stats)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL