mathtoolset2

package
v0.13.204 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnkonow - unknow error
	ErrUnkonow = errors.New("unknow error")

	// ErrInvalidReel - invalid reel
	ErrInvalidReel = errors.New("invalid reel")

	// ErrInvalidInReelSymbolType - invalid InReelSymbolType
	ErrInvalidInReelSymbolType = errors.New("invalid InReelSymbolType")

	// ErrInvalidReelsStatsExcelFile - invalid ReelsStats excel file
	ErrInvalidReelsStatsExcelFile = errors.New("invalid ReelsStats excel file")

	// ErrInvalidReelsStatsExcelColname - invalid ReelsStats excel colname
	ErrInvalidReelsStatsExcelColname = errors.New("invalid ReelsStats excel colname")

	// ErrNoValidSymbols - no valid symbols
	ErrNoValidSymbols = errors.New("no valid symbols")

	// ErrValidParamInAutoChgWeights - invalid param in AutoChgWeights
	ErrValidParamInAutoChgWeights = errors.New("invalid param in AutoChgWeights")

	// ErrInvalidDataInAGRDataList - invalid data in agrDataList
	ErrInvalidDataInAGRDataList = errors.New("invalid data in agrDataList")

	// ErrNoResultInAutoChgWeights - no result in AutoChgWeights
	ErrNoResultInAutoChgWeights = errors.New("no result in AutoChgWeights")

	// ErrInvalidReelsWithMinOff - invalid reels with minoff
	ErrInvalidReelsWithMinOff = errors.New("invalid reels with minoff")

	// ErrInvalidCode - invalid code
	ErrInvalidCode = errors.New("invalid code")

	// ErrInvalidFunctionParams - invalid function params
	ErrInvalidFunctionParams = errors.New("invalid function params")

	// ErrInvalidTargetRTP - invalid targetRTP
	ErrInvalidTargetRTP = errors.New("invalid targetRTP")

	// ErrUnimplementedCode - unimplemented code
	ErrUnimplementedCode = errors.New("unimplemented code")

	// ErrInvalidScatterNumber - invalid scatter number
	ErrInvalidScatterNumber = errors.New("invalid scatter number")

	// ErrCannotBeConverged - cannot be converged
	ErrCannotBeConverged = errors.New("cannot be converged")

	// ErrWinWeightMerge - WinWeight.Merge error
	ErrWinWeightMerge = errors.New("WinWeight.Merge error")
	// ErrWinWeightScale - WinWeight.scale error
	ErrWinWeightScale = errors.New("WinWeight.scale error")
	// ErrDuplicateAvgWin - duplicate avgwin
	ErrDuplicateAvgWin = errors.New("duplicate avgwin")

	// ErrInvalidReelsStats2File - invalid reelsstats2 file
	ErrInvalidReelsStats2File = errors.New("invalid reelsstats2 file")
	// ErrGenStackReel - genStackReel error
	ErrGenStackReel = errors.New("genStackReel error")

	// ErrReturnNotOK -
	ErrReturnNotOK = errors.New("return not ok")

	// ErrRunError -
	ErrRunError = errors.New("run error")

	// ErrInvalidFileData - invalid filedata
	ErrInvalidFileData = errors.New("invalid filedata")
)

Functions

func AbsInt added in v0.13.179

func AbsInt(v0, v1 int) int

func CountSymbolInReel

func CountSymbolInReel(symbol SymbolType, reel []int, stop int, height int) int

CountSymbolInReel - count symbol number in reel,[stop, stop + height)

func GenStackReels

func GenStackReels(reader io.Reader, stack []int, excludeSymbol []string) ([][]string, error)

func List2IntSlice

func List2IntSlice(val ref.Val) []int

func List2StrSlice

func List2StrSlice(val ref.Val) []string

func LoadReels added in v0.13.157

func LoadReels(reader io.Reader) ([][]string, error)

func MergeReels added in v0.13.157

func MergeReels(readers []io.Reader) ([][]string, error)

func NewExcelFile

func NewExcelFile(reels [][]string) *excelize.File

func SaveReels

func SaveReels(fn string, reels [][]string) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client - MathToolsetClient

func NewClient

func NewClient(servAddr string) (*Client, error)

NewClient - new MathToolsetClient

func (*Client) RunScript

func (client *Client) RunScript(ctx context.Context, script string, mapFiles map[string]string) (*sgc7pb.ReplyRunScript, error)

RunScript - run script

type FileDataMap

type FileDataMap struct {
	MapFiles map[string]string `json:"files"`
}

func NewFileDataMap

func NewFileDataMap(fd string) (*FileDataMap, error)

func (*FileDataMap) AddBuffer

func (mapfd *FileDataMap) AddBuffer(fn string, buf *bytes.Buffer)

func (*FileDataMap) AddReader

func (mapfd *FileDataMap) AddReader(fn string, r io.Reader) error

func (*FileDataMap) GetReader

func (mapfd *FileDataMap) GetReader(fn string) io.Reader

func (*FileDataMap) ToJson

func (mapfd *FileDataMap) ToJson() (string, error)

type ReelStats2

type ReelStats2 struct {
	MapSymbols     map[string]int
	TotalSymbolNum int
}

type ReelsStats2

type ReelsStats2 struct {
	Reels   []*ReelStats2
	Symbols []string
}

func LoadReelsStats2

func LoadReelsStats2(reader io.Reader) (*ReelsStats2, error)

func NewReelsStats2

func NewReelsStats2(reelnum int) *ReelsStats2

type ScriptCore

type ScriptCore struct {
	Cel            *cel.Env
	FileData       string
	MapFiles       *FileDataMap
	ErrInRun       []error
	MapOutputFiles *FileDataMap
}

func NewScriptCore

func NewScriptCore(fileData string) (*ScriptCore, error)

func (*ScriptCore) Run

func (sc *ScriptCore) Run(code string) error

type Serv

type Serv struct {
	sgc7pb.UnimplementedMathToolsetServer
	// contains filtered or unexported fields
}

Serv - Service

func NewServ

func NewServ(bindaddr string, version string, useOpenTelemetry bool) (*Serv, error)

NewServ -

func (*Serv) RunScript

func (serv *Serv) RunScript(ctx context.Context, req *sgc7pb.RunScript) (*sgc7pb.ReplyRunScript, error)

initGame - initial game

func (*Serv) Start

func (serv *Serv) Start(ctx context.Context) error

Start - start a service

func (*Serv) Stop

func (serv *Serv) Stop()

Stop - stop service

type SymbolType

type SymbolType int

func GetSymbols

func GetSymbols(arr []string, paytables *sgc7game.PayTables) []SymbolType

Jump to

Keyboard shortcuts

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