stats2

package
v0.13.199 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v0.13.99

type Cache struct {
	MapStats map[string]*Feature
	Bet      int
	TotalWin int64
}

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)

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) ProcStatsForeachTrigger added in v0.13.115

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

func (*Cache) ProcStatsOnEnding added in v0.13.115

func (s2 *Cache) ProcStatsOnEnding(win int64)

func (*Cache) ProcStatsRootTrigger added in v0.13.99

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

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
}

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
)

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"`
	BetEndingTimes int64    `json:"-"`
	Components     []string `json:"components"`
	// 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) 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 StatsRootTrigger added in v0.13.99

type StatsRootTrigger struct {
	RunTimes     int64 `json:"runTimes"`
	TriggerTimes int64 `json:"triggerTimes"`
	TotalWins    int64 `json:"totalWins"`
	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 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]int `json:"mapWinTimes"`
}

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, totalBet int64)

Jump to

Keyboard shortcuts

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