Documentation ¶
Index ¶
- Constants
- Variables
- func DropDownSymbols(scene *GameScene) error
- func DropDownSymbols2(scene *GameScene) error
- func GetPlayResultCurIndex(prs []*PlayResult) int
- func LoadExcel(fn string, sheet string, onheader FuncProcHeader, ondata FuncProcData) error
- func LoadGameConfig(fn string, cfg interface{}) error
- func PlayResult2JSON(pr *PlayResult) ([]byte, error)
- func RandList(plugin sgc7plugin.IPlugin, arr []int, num int) ([]int, error)
- func RandWithWeights(plugin sgc7plugin.IPlugin, max int, arr []int) (int, error)
- func RemoveSymbolWithResult(scene *GameScene, result *PlayResult) error
- type ArrValWeights
- type BasicGame
- func (game *BasicGame) AddGameMod(gmod IGameMod) error
- func (game *BasicGame) CheckStake(stake *Stake) error
- func (game *BasicGame) FreePlugin(plugin sgc7plugin.IPlugin)
- func (game *BasicGame) GetConfig() *Config
- func (game *BasicGame) Initialize() IPlayerState
- func (game *BasicGame) NewPlayerState() IPlayerState
- func (game *BasicGame) NewPlugin() sgc7plugin.IPlugin
- func (game *BasicGame) Play(plugin sgc7plugin.IPlugin, cmd string, param string, ps IPlayerState, ...) (*PlayResult, error)
- func (game *BasicGame) ResetConfig(cfg interface{})
- func (game *BasicGame) SetVer(ver string)
- type BasicGameConfig
- type BasicGameMod
- func (mod *BasicGameMod) GetName() string
- func (mod *BasicGameMod) NewPlayResult(gamemodparams interface{}) *PlayResult
- func (mod *BasicGameMod) NewPlayResult2(gamemodparams interface{}, prs []*PlayResult, parentIndex int, modType string) *PlayResult
- func (mod *BasicGameMod) OnPlay(game IGame, plugin sgc7plugin.IPlugin, cmd string, param string, ...) (*PlayResult, error)
- func (mod *BasicGameMod) RandomScene(game IGame, plugin sgc7plugin.IPlugin, reelsName string, gs *GameScene) (*GameScene, error)
- type BasicPlayerPrivateState
- type BasicPlayerPublicState
- type BasicPlayerState
- func (ps *BasicPlayerState) GetCurGameMod() string
- func (ps *BasicPlayerState) GetPrivate() interface{}
- func (ps *BasicPlayerState) GetPrivateJson() string
- func (ps *BasicPlayerState) GetPublic() interface{}
- func (ps *BasicPlayerState) GetPublicJson() string
- func (ps *BasicPlayerState) SetCurGameMod(gamemod string)
- func (ps *BasicPlayerState) SetPrivate(pri interface{}) error
- func (ps *BasicPlayerState) SetPrivateJson(prijson string) error
- func (ps *BasicPlayerState) SetPublic(pub interface{}) error
- func (ps *BasicPlayerState) SetPublicJson(pubjson string) error
- type Config
- func (cfg *Config) AddDefaultSceneString2(str string) error
- func (cfg *Config) LoadLine(fn string, reels int) error
- func (cfg *Config) LoadLine3(fn string) error
- func (cfg *Config) LoadLine5(fn string) error
- func (cfg *Config) LoadLine6(fn string) error
- func (cfg *Config) LoadLineDataFromExcel(fn string) error
- func (cfg *Config) LoadPayTables(fn string, reels int) error
- func (cfg *Config) LoadPayTables15(fn string) error
- func (cfg *Config) LoadPayTables3(fn string) error
- func (cfg *Config) LoadPayTables5(fn string) error
- func (cfg *Config) LoadPayTables6(fn string) error
- func (cfg *Config) LoadPaytablesFromExcel(fn string) error
- func (cfg *Config) LoadReels(name string, fn string, reels int) error
- func (cfg *Config) LoadReels3(name string, fn string) error
- func (cfg *Config) LoadReels5(name string, fn string) error
- func (cfg *Config) LoadReelsFromExcel(tag string, fn string) error
- func (cfg *Config) LoadSymboloWeightReels(name string, fn string, reels int) error
- func (cfg *Config) SetDefaultSceneString(str string) error
- type FastReelsRandomSP
- type FloatVal
- func (val *FloatVal[T]) Float32() float32
- func (val *FloatVal[T]) Float32Arr() []float32
- func (val *FloatVal[T]) Float64() float64
- func (val *FloatVal[T]) Float64Arr() []float64
- func (val *FloatVal[T]) Int() int
- func (val *FloatVal[T]) Int32() int32
- func (val *FloatVal[T]) Int32Arr() []int32
- func (val *FloatVal[T]) Int64() int64
- func (val *FloatVal[T]) Int64Arr() []int64
- func (val *FloatVal[T]) IntArr() []int
- func (val *FloatVal[T]) IsSame(right IVal) bool
- func (val *FloatVal[T]) ParseString(str string) error
- func (val *FloatVal[T]) String() string
- func (val *FloatVal[T]) StringArr() []string
- func (val *FloatVal[T]) Type() string
- type FloatValMapping
- func LoadFloatValMappingFromExcel[T int, V float32 | float64](fn string, headerType string, headerVal string) (*FloatValMapping[T, V], error)
- func NewFloatValMapping[T int, V float32 | float64](typevals []T, vals []V) (*FloatValMapping[T, V], error)
- func NewFloatValMappingEx[T int, V float32 | float64]() *FloatValMapping[T, V]
- type FuncCalcOtherMul
- type FuncCalcOtherMulEx
- type FuncCountSymbolExIsSymbol
- type FuncCountSymbolInReel
- type FuncForEach
- type FuncGetSymbol
- type FuncIsSameSymbol
- type FuncIsSameSymbolEx
- type FuncIsScatter
- type FuncIsSymbol
- type FuncIsValidSymbol
- type FuncIsValidSymbolEx
- type FuncIsWild
- type FuncNewBasicPlayerState
- type FuncNewIVal
- type FuncOnSelectReelIndex
- type FuncProcData
- type FuncProcHeader
- type FuncReelsDataPos
- type GameScene
- func NewGameScene(width int, height int) (*GameScene, error)
- func NewGameSceneEx(heights []int) (*GameScene, error)
- func NewGameSceneWithArr(w, h int, arr []int) (*GameScene, error)
- func NewGameSceneWithArr2(arr [][]int) (*GameScene, error)
- func NewGameSceneWithArr2Ex(arr [][]int) (*GameScene, error)
- func NewGameSceneWithReels(reels *ReelsData, w, h int, arr []int) (*GameScene, error)
- func (gs *GameScene) Clone() *GameScene
- func (gs *GameScene) CountSymbol(s int) int
- func (gs *GameScene) CountSymbolEx(issymbol FuncCountSymbolExIsSymbol) int
- func (gs *GameScene) CountSymbols(arr []int) []int
- func (gs *GameScene) Fill(reels *ReelsData, arr []int)
- func (gs *GameScene) ForEach(funcEach FuncForEach)
- func (gs *GameScene) ForEachAround(x, y int, funcEachAround FuncForEach)
- func (gs *GameScene) HasSymbol(s int) bool
- func (gs *GameScene) Init(w int, h int) error
- func (gs *GameScene) InitEx(h []int) error
- func (gs *GameScene) InitWithArr(w int, h int, arr []int) error
- func (gs *GameScene) InitWithArr2(arr [][]int) error
- func (gs *GameScene) InitWithArr2Ex(arr [][]int) error
- func (gs *GameScene) RandReels(game IGame, plugin sgc7plugin.IPlugin, reelsName string) error
- func (gs *GameScene) RandReelsEx(game IGame, plugin sgc7plugin.IPlugin, reelsName string, rpd *ReelsPosData, ...) error
- func (gs *GameScene) RandReelsEx2(game IGame, plugin sgc7plugin.IPlugin, reelsName string, rpd0 *ReelsPosData, ...) error
- func (gs *GameScene) RandReelsEx3(game IGame, plugin sgc7plugin.IPlugin, reelsName string, rpd0 *ReelsPosData, ...) error
- func (gs *GameScene) RandReelsWithReelData(reels *ReelsData, plugin sgc7plugin.IPlugin) error
- func (gs *GameScene) ReplaceSymbol(src int, dst int)
- func (gs *GameScene) ResetReelIndex(game IGame, reelsName string, x int, index int) error
- func (gs *GameScene) SetReels(game IGame, reelsName string, pos []int) error
- type IGame
- type IGameMod
- type IPlayerState
- type IVal
- type IntArrVal
- func (val *IntArrVal[T]) Float32() float32
- func (val *IntArrVal[T]) Float32Arr() []float32
- func (val *IntArrVal[T]) Float64() float64
- func (val *IntArrVal[T]) Float64Arr() []float64
- func (val *IntArrVal[T]) Int() int
- func (val *IntArrVal[T]) Int32() int32
- func (val *IntArrVal[T]) Int32Arr() []int32
- func (val *IntArrVal[T]) Int64() int64
- func (val *IntArrVal[T]) Int64Arr() []int64
- func (val *IntArrVal[T]) IntArr() []int
- func (val *IntArrVal[T]) IsSame(right IVal) bool
- func (val *IntArrVal[T]) ParseString(str string) error
- func (val *IntArrVal[T]) String() string
- func (val *IntArrVal[T]) StringArr() []string
- func (val *IntArrVal[T]) Type() string
- type IntVal
- func (val *IntVal[T]) Float32() float32
- func (val *IntVal[T]) Float32Arr() []float32
- func (val *IntVal[T]) Float64() float64
- func (val *IntVal[T]) Float64Arr() []float64
- func (val *IntVal[T]) Int() int
- func (val *IntVal[T]) Int32() int32
- func (val *IntVal[T]) Int32Arr() []int32
- func (val *IntVal[T]) Int64() int64
- func (val *IntVal[T]) Int64Arr() []int64
- func (val *IntVal[T]) IntArr() []int
- func (val *IntVal[T]) IsSame(right IVal) bool
- func (val *IntVal[T]) ParseString(str string) error
- func (val *IntVal[T]) String() string
- func (val *IntVal[T]) StringArr() []string
- func (val *IntVal[T]) Type() string
- type LineData
- type PayTables
- func LoadPayTables15JSON(fn string) (*PayTables, error)
- func LoadPayTables25JSON(fn string) (*PayTables, error)
- func LoadPayTables3JSON(fn string) (*PayTables, error)
- func LoadPayTables5JSON(fn string) (*PayTables, error)
- func LoadPayTables6JSON(fn string) (*PayTables, error)
- func LoadPaytablesFromExcel(fn string) (*PayTables, error)
- type PlayResult
- type ReelsData
- func (rd *ReelsData) BuildReelsPosData(onpos FuncReelsDataPos) (*ReelsPosData, error)
- func (rd *ReelsData) DropDownIntoGameScene(scene *GameScene, indexes []int) ([]int, error)
- func (rd *ReelsData) DropDownIntoGameScene2(scene *GameScene, indexes []int) ([]int, error)
- func (rd *ReelsData) SaveExcel(fn string) error
- func (rd *ReelsData) SetReel(ri int, reel []int)
- type ReelsPosData
- type Result
- func CalcClusterResult(scene *GameScene, pt *PayTables, bet int, isValidSymbol FuncIsValidSymbol, ...) ([]*Result, error)
- func CalcFullLine(scene *GameScene, pt *PayTables, bet int, isValidSymbolEx FuncIsValidSymbolEx, ...) []*Result
- func CalcFullLineEx(scene *GameScene, pt *PayTables, bet int, isValidSymbolEx FuncIsValidSymbolEx, ...) []*Result
- func CalcFullLineEx2(scene *GameScene, pt *PayTables, bet int, isValidSymbolEx FuncIsValidSymbolEx, ...) []*Result
- func CalcLine(scene *GameScene, pt *PayTables, ld []int, bet int, ...) *Result
- func CalcLineEx(scene *GameScene, pt *PayTables, ld []int, bet int, ...) *Result
- func CalcLineOtherMul(scene *GameScene, pt *PayTables, ld []int, bet int, ...) *Result
- func CalcScatter(scene *GameScene, pt *PayTables, scatter int, bet int, coins int, ...) *Result
- func CalcScatter2(scene *GameScene, pt *PayTables, scatter int, bet int, coins int, ...) *Result
- func CalcScatter3(scene *GameScene, pt *PayTables, scatter int, bet int, coins int, ...) *Result
- func CalcScatter4(scene *GameScene, pt *PayTables, scatter int, bet int, isScatter FuncIsScatter, ...) *Result
- func CalcScatterEx(scene *GameScene, scatter int, nums int, isScatter FuncIsScatter) *Result
- func CalcScatterOnReels(scene *GameScene, scatter int, nums int, isScatter FuncIsScatter) *Result
- type ResultType
- type Stake
- type StrVal
- func (val *StrVal) Float32() float32
- func (val *StrVal) Float32Arr() []float32
- func (val *StrVal) Float64() float64
- func (val *StrVal) Float64Arr() []float64
- func (val *StrVal) Int() int
- func (val *StrVal) Int32() int32
- func (val *StrVal) Int32Arr() []int32
- func (val *StrVal) Int64() int64
- func (val *StrVal) Int64Arr() []int64
- func (val *StrVal) IntArr() []int
- func (val *StrVal) IsSame(right IVal) bool
- func (val *StrVal) ParseString(str string) error
- func (val *StrVal) String() string
- func (val *StrVal) StringArr() []string
- func (val *StrVal) Type() string
- type StrValWeights
- type SymbolWeightReelData
- type SymbolWeightReels
- type SymbolWeightReelsData
- type SymbolWeightReelsDataSet
- type ValArrMapping
- func LoadValArrMappingFromExcel[T int, V int | int32 | int64](fn string, headerType string, headerVal string) (*ValArrMapping[T, V], error)
- func NewValArrMapping[T int, V int | int32 | int64](typevals []T, vals [][]V) (*ValArrMapping[T, V], error)
- func NewValArrMappingEx[T int, V int | int32 | int64]() *ValArrMapping[T, V]
- type ValMapping
- func LoadValMappingFromExcel[T int, V int | int32 | int64](fn string, headerType string, headerVal string) (*ValMapping[T, V], error)
- func NewValMapping[T int, V int | int32 | int64](typevals []T, vals []V) (*ValMapping[T, V], error)
- func NewValMappingEx[T int, V int | int32 | int64]() *ValMapping[T, V]
- type ValMapping2
- type ValWeights
- func (vw *ValWeights) Add(val int, weight int)
- func (vw *ValWeights) ClearExcludeVal(val int)
- func (vw *ValWeights) Clone() *ValWeights
- func (vw *ValWeights) CloneExcludeVal(val int) (*ValWeights, error)
- func (vw *ValWeights) GetWeight(val int) int
- func (vw *ValWeights) RandVal(plugin sgc7plugin.IPlugin) (int, error)
- func (vw *ValWeights) Reset(vals []int, weights []int)
- func (vw *ValWeights) SortBy(dst *ValWeights) error
- type ValWeights2
- func LoadValWeights2FromExcel(fn string, headerVal string, headerWeight string, funcNew FuncNewIVal) (*ValWeights2, error)
- func LoadValWeights2FromExcelWithSymbols(fn string, headerVal string, headerWeight string, paytables *PayTables) (*ValWeights2, error)
- func NewValWeights2(vals []IVal, weights []int) (*ValWeights2, error)
- func NewValWeights2Ex() *ValWeights2
- func (vw *ValWeights2) Add(val IVal, weight int)
- func (vw *ValWeights2) ClearExcludeVal(val IVal)
- func (vw *ValWeights2) Clone() *ValWeights2
- func (vw *ValWeights2) CloneExcludeVal(val IVal) (*ValWeights2, error)
- func (vw *ValWeights2) GetWeight(val IVal) int
- func (vw *ValWeights2) RandVal(plugin sgc7plugin.IPlugin) (IVal, error)
- func (vw *ValWeights2) RemoveVal(val IVal) error
- func (vw *ValWeights2) Reset(vals []IVal, weights []int)
- func (vw *ValWeights2) SortBy(dst *ValWeights2) error
Constants ¶
const ( // RTScatter - scatter RTScatter = 1 // RTLine - line RTLine = 2 // RTFullLine - full line // 243线游戏,最多会出现243条记录,某些游戏必须要这种方式 RTFullLine = 3 // RTFullLineEx - full line ex // 全线游戏的汇总记录,243线最多3条记录 RTFullLineEx = 4 // RTScatterEx - scatter只计数量 RTScatterEx = 5 // RTCluster - cluster,族群方式 RTCluster = 6 // RTScatterOnReels - scatter只统计列数 RTScatterOnReels = 7 )
const FloatValType string = "floatval"
const IntArrValType string = "intarrval"
const IntValType string = "intval"
const StrValType string = "strval"
Variables ¶
var ( // ErrUnkonow - unknow error ErrUnkonow = errors.New("unknow error") // ErrInvalidReelsName - invalid reels name ErrInvalidReelsName = errors.New("invalid reels name") // ErrInvalidStake - invalid stake ErrInvalidStake = errors.New("invalid stake") // ErrDuplicateGameMod - duplicate gamemod ErrDuplicateGameMod = errors.New("duplicate gamemod") // ErrInvalidGameMod - invalid GameMod ErrInvalidGameMod = errors.New("invalid GameMod") // ErrInvalidWHGameMod - invalid Width or Height in GameMod ErrInvalidWHGameMod = errors.New("invalid Width or Height in GameMod") // ErrInvalidCommand - invalid command ErrInvalidCommand = errors.New("invalid command") // ErrInvalidBasicPlayerState - invalid BasicPlayerState ErrInvalidBasicPlayerState = errors.New("invalid BasicPlayerState") // ErrInvalidPlayerPublicState - invalid PlayerPublicState ErrInvalidPlayerPublicState = errors.New("invalid PlayerPublicState") // ErrInvalidPlayerPrivateState - invalid PlayerPrivateState ErrInvalidPlayerPrivateState = errors.New("invalid PlayerPrivateState") // ErrNonGameModCalcScene - non CalcScene in GameMod ErrNonGameModCalcScene = errors.New("non CalcScene in GameMod") // ErrNonGameModPayout - non Payout in GameMod ErrNonGameModPayout = errors.New("non Payout in GameMod") // ErrInvalidWeights - invalid weights ErrInvalidWeights = errors.New("invalid weights") // ErrNullConfig - null config ErrNullConfig = errors.New("null config") // ErrInvalidArray - invalid array ErrInvalidArray = errors.New("invalid array") // ErrInvalidSceneX - invalid scene x ErrInvalidSceneX = errors.New("invalid scene x") // ErrInvalidReels - invalid reels ErrInvalidReels = errors.New("invalid reels") // ErrInvalidSymbolWeightReelsSetType1 - invalid settype1 in SymbolWeightReels ErrInvalidSymbolWeightReelsSetType1 = errors.New("invalid settype1 in SymbolWeightReels") // ErrInvalidSymbolWeightReelsSetType2 - invalid settype2 in SymbolWeightReels ErrInvalidSymbolWeightReelsSetType2 = errors.New("invalid settype2 in SymbolWeightReels") // ErrInvalidSymbolWeightWidthReels - invalid width in SymbolWeightReels ErrInvalidSymbolWeightWidthReels = errors.New("invalid width in SymbolWeightReels") // ErrInvalidReelsExcelFile - invalid reels xlsx ErrInvalidReelsExcelFile = errors.New("invalid reels xlsx") // ErrInvalidParam - invalid param ErrInvalidParam = errors.New("invalid param") // ErrInvalidValWeights - invalid ValWeights ErrInvalidValWeights = errors.New("invalid ValWeights") // ErrInvalidValWeightsVal - invalid ValWeights value ErrInvalidValWeightsVal = errors.New("invalid ValWeights value") // ErrInvalidValMapping - invalid ValMapping ErrInvalidValMapping = errors.New("invalid ValMapping") )
Functions ¶
func DropDownSymbols ¶
DropDownSymbols - drop down symbols
func DropDownSymbols2 ¶
DropDownSymbols2 - drop down symbols, y0 is at the buttom
func GetPlayResultCurIndex ¶
func GetPlayResultCurIndex(prs []*PlayResult) int
GetPlayResultCurIndex - get current index
func LoadExcel ¶
func LoadExcel(fn string, sheet string, onheader FuncProcHeader, ondata FuncProcData) error
func LoadGameConfig ¶
LoadGameConfig - load configuration
func PlayResult2JSON ¶
func PlayResult2JSON(pr *PlayResult) ([]byte, error)
PlayResult2JSON - PlayResult => json
func RandWithWeights ¶
RandWithWeights - random with the weights
func RemoveSymbolWithResult ¶
func RemoveSymbolWithResult(scene *GameScene, result *PlayResult) error
RemoveSymbolWithResult - remove symbol with win result
Types ¶
type ArrValWeights ¶
ArrValWeights
func LoadArrValWeightsFromExcel ¶
func LoadArrValWeightsFromExcel(fn string) (*ArrValWeights, error)
LoadArrValWeightsFromExcel - load xlsx file
func NewArrValWeights ¶
func NewArrValWeights(arrvals [][]int, weights []int) (*ArrValWeights, error)
func (*ArrValWeights) RandVal ¶
func (vw *ArrValWeights) RandVal(plugin sgc7plugin.IPlugin) ([]int, error)
type BasicGame ¶
type BasicGame struct { Cfg *Config MapGameMods map[string]IGameMod MgrPlugins *sgc7plugin.PluginsMgr }
BasicGame - basic game
func NewBasicGame ¶
func NewBasicGame(funcNewPlugin sgc7plugin.FuncNewPlugin) *BasicGame
NewBasicGame - new a BasicGame
func (*BasicGame) AddGameMod ¶
AddGameMod - add a gamemod
func (*BasicGame) CheckStake ¶
CheckStake - check stake
func (*BasicGame) FreePlugin ¶
func (game *BasicGame) FreePlugin(plugin sgc7plugin.IPlugin)
FreePlugin - free a plugin
func (*BasicGame) Initialize ¶
func (game *BasicGame) Initialize() IPlayerState
Initialize - initialize PlayerState
func (*BasicGame) NewPlayerState ¶
func (game *BasicGame) NewPlayerState() IPlayerState
NewPlayerState - new playerstate
func (*BasicGame) NewPlugin ¶
func (game *BasicGame) NewPlugin() sgc7plugin.IPlugin
NewPlugin - new a plugin
func (*BasicGame) Play ¶
func (game *BasicGame) Play(plugin sgc7plugin.IPlugin, cmd string, param string, ps IPlayerState, stake *Stake, prs []*PlayResult) (*PlayResult, error)
Play - play
type BasicGameConfig ¶
type BasicGameConfig struct { LineData string `yaml:"linedata"` PayTables string `yaml:"paytables"` Reels map[string]string `yaml:"reels"` }
BasicGameConfig - configuration for basic game
func (BasicGameConfig) Init5 ¶
func (bgc BasicGameConfig) Init5(ig IGame) error
Init5 - initial with 5 reels
type BasicGameMod ¶
BasicGameMod - basic gameMod
func NewBasicGameMod ¶
func NewBasicGameMod(name string, w int, h int) *BasicGameMod
NewBasicGameMod - new a BasicGameMod
func (*BasicGameMod) NewPlayResult ¶
func (mod *BasicGameMod) NewPlayResult(gamemodparams interface{}) *PlayResult
NewPlayResult - new a PlayResult
func (*BasicGameMod) NewPlayResult2 ¶
func (mod *BasicGameMod) NewPlayResult2(gamemodparams interface{}, prs []*PlayResult, parentIndex int, modType string) *PlayResult
NewPlayResult2 - new a PlayResult
func (*BasicGameMod) OnPlay ¶
func (mod *BasicGameMod) OnPlay(game IGame, plugin sgc7plugin.IPlugin, cmd string, param string, ps IPlayerState, stake *Stake, prs []*PlayResult) (*PlayResult, error)
OnPlay - on play
func (*BasicGameMod) RandomScene ¶
func (mod *BasicGameMod) RandomScene(game IGame, plugin sgc7plugin.IPlugin, reelsName string, gs *GameScene) (*GameScene, error)
RandomScene - on random scene
type BasicPlayerPrivateState ¶
type BasicPlayerPrivateState struct { }
BasicPlayerPrivateState - basic PlayerPrivateState
type BasicPlayerPublicState ¶
type BasicPlayerPublicState struct { CurGameMod string `json:"curgamemod"` NextM int `json:"nextm"` }
BasicPlayerPublicState - basic PlayerPublicState
type BasicPlayerState ¶
type BasicPlayerState struct { Public *BasicPlayerPublicState Private *BasicPlayerPrivateState }
BasicPlayerState - basic PlayerState
func NewBPSNoBoostData ¶
func NewBPSNoBoostData() *BasicPlayerState
NewBPSNoBoostData - new a BasicPlayerState without boostdata
func NewBasicPlayerState ¶
func NewBasicPlayerState(curgamemod string) *BasicPlayerState
NewBasicPlayerState - new BasicPlayerState
func (*BasicPlayerState) GetCurGameMod ¶
func (ps *BasicPlayerState) GetCurGameMod() string
GetCurGameMod - get current game module
func (*BasicPlayerState) GetPrivate ¶
func (ps *BasicPlayerState) GetPrivate() interface{}
GetPrivate - get player private state
func (*BasicPlayerState) GetPrivateJson ¶
func (ps *BasicPlayerState) GetPrivateJson() string
GetPrivateJson - set player private state
func (*BasicPlayerState) GetPublic ¶
func (ps *BasicPlayerState) GetPublic() interface{}
GetPublic - get player public state
func (*BasicPlayerState) GetPublicJson ¶
func (ps *BasicPlayerState) GetPublicJson() string
GetPublicJson - set player public state
func (*BasicPlayerState) SetCurGameMod ¶
func (ps *BasicPlayerState) SetCurGameMod(gamemod string)
SetCurGameMod - set current game module
func (*BasicPlayerState) SetPrivate ¶
func (ps *BasicPlayerState) SetPrivate(pri interface{}) error
SetPrivate - set player private state
func (*BasicPlayerState) SetPrivateJson ¶
func (ps *BasicPlayerState) SetPrivateJson(prijson string) error
SetPrivateJson - set player private state
func (*BasicPlayerState) SetPublic ¶
func (ps *BasicPlayerState) SetPublic(pub interface{}) error
SetPublic - set player public state
func (*BasicPlayerState) SetPublicJson ¶
func (ps *BasicPlayerState) SetPublicJson(pubjson string) error
SetPublicJson - set player public state
type Config ¶
type Config struct { Lines *LineData `json:"lines"` Reels map[string]*ReelsData `json:"reels"` PayTables *PayTables `json:"paytables"` Width int `json:"width"` Height int `json:"height"` DefaultScene *GameScene `json:"defaultscene"` Ver string `json:"ver"` CoreVer string `json:"corever"` SWReels map[string]*SymbolWeightReels `json:"-"` DefaultScene2 []*GameScene `json:"defaultscene2"` BetMuls []int32 `json:"betMuls"` }
Config - config
func (*Config) AddDefaultSceneString2 ¶
AddDefaultSceneString2 - [][]int in json
func (*Config) LoadLineDataFromExcel ¶
LoadLineDataFromExcel - load linedata for reels
func (*Config) LoadPayTables ¶
LoadPayTables - load paytables for reels
func (*Config) LoadPayTables15 ¶
LoadPayTables15 - load paytables for reels 15
func (*Config) LoadPayTables3 ¶
LoadPayTables3 - load paytables for reels 3
func (*Config) LoadPayTables5 ¶
LoadPayTables5 - load paytables for reels 5
func (*Config) LoadPayTables6 ¶
LoadPayTables6 - load paytables for reels 6
func (*Config) LoadPaytablesFromExcel ¶
LoadPaytablesFromExcel - load linedata for reels
func (*Config) LoadReels3 ¶
LoadReels3 - load reels 3
func (*Config) LoadReels5 ¶
LoadReels5 - load reels 5
func (*Config) LoadReelsFromExcel ¶
LoadReelsFromExcel - load linedata for reels
func (*Config) LoadSymboloWeightReels ¶
LoadSymboloWeightReels - load reels for SymbolWeightReels
func (*Config) SetDefaultSceneString ¶
SetDefaultSceneString - [][]int in json
type FastReelsRandomSP ¶
FastReelsRandomSP - fast random for a special scene, it's like scatter x 5
func NewFastReelsRandomSP ¶
func NewFastReelsRandomSP(reels *ReelsData, onSelectReelIndex FuncOnSelectReelIndex) *FastReelsRandomSP
NewFastReelsRandomSP - new a FastReelsRandomSP
func (*FastReelsRandomSP) Random ¶
func (frr *FastReelsRandomSP) Random(plugin sgc7plugin.IPlugin) ([]int, error)
Random - random
type FloatVal ¶
FloatVal
func (*FloatVal[T]) Float32Arr ¶
Float32Arr - return a []float32
func (*FloatVal[T]) Float64Arr ¶
Float64Arr - return a []float64
func (*FloatVal[T]) ParseString ¶
type FloatValMapping ¶
FloatValMapping
func LoadFloatValMappingFromExcel ¶
func LoadFloatValMappingFromExcel[T int, V float32 | float64](fn string, headerType string, headerVal string) (*FloatValMapping[T, V], error)
LoadFloatValMappingFromExcel - load xlsx file
func NewFloatValMapping ¶
func NewFloatValMapping[T int, V float32 | float64](typevals []T, vals []V) (*FloatValMapping[T, V], error)
func NewFloatValMappingEx ¶
func NewFloatValMappingEx[T int, V float32 | float64]() *FloatValMapping[T, V]
func (*FloatValMapping[T, V]) Clone ¶
func (vm *FloatValMapping[T, V]) Clone() *FloatValMapping[T, V]
func (*FloatValMapping[T, V]) Keys ¶
func (vm *FloatValMapping[T, V]) Keys() []T
type FuncCalcOtherMul ¶
FuncCalcOtherMul - calc other multi
type FuncCalcOtherMulEx ¶
FuncCalcOtherMulEx - calc other multi
type FuncCountSymbolExIsSymbol ¶
FuncCountSymbolExIsSymbol -
type FuncCountSymbolInReel ¶
FuncCountSymbolInReel - count symbol nums in a reel
type FuncIsSameSymbol ¶
FuncIsSameSymbol - cursymbol == startsymbol
type FuncIsSameSymbolEx ¶
FuncIsSameSymbolEx - cursymbol == startsymbol
type FuncIsScatter ¶
FuncIsScatter - cursymbol == scatter
type FuncIsValidSymbol ¶
FuncIsValidSymbol - is it a valid symbol?
type FuncIsValidSymbolEx ¶
FuncIsValidSymbolEx - is it a valid symbol?
type FuncNewBasicPlayerState ¶
type FuncNewBasicPlayerState func() *BasicPlayerState
FuncNewBasicPlayerState - new BasicPlayerState and set PlayerBoostData
type FuncNewIVal ¶
type FuncNewIVal func() IVal
type FuncOnSelectReelIndex ¶
FuncOnSelectReelIndex - onSelectReelIndex
type FuncProcHeader ¶
type FuncReelsDataPos ¶
主要用于BuildReelsPosData接口
type GameScene ¶
type GameScene struct { Arr [][]int `json:"arr"` Width int `json:"-"` Height int `json:"-"` Indexes []int `json:"indexes"` ValidRow []int `json:"validrow"` HeightEx []int `json:"-"` }
GameScene - game scene
func NewGameScene ¶
NewGameScene - new a GameScene
func NewGameSceneEx ¶
NewGameSceneEx - new a GameScene
func NewGameSceneWithArr ¶
NewGameSceneWithArr - new a GameScene
func NewGameSceneWithArr2 ¶
NewGameSceneWithArr2 - new a GameScene
func NewGameSceneWithArr2Ex ¶
NewGameSceneWithArr2Ex - new a GameScene
func NewGameSceneWithReels ¶
NewGameSceneWithReels - new a GameScene
func (*GameScene) CountSymbol ¶
CountSymbol - count a symbol
func (*GameScene) CountSymbolEx ¶
func (gs *GameScene) CountSymbolEx(issymbol FuncCountSymbolExIsSymbol) int
CountSymbolEx - count a symbol
func (*GameScene) CountSymbols ¶
CountSymbols - count some symbols
func (*GameScene) ForEach ¶
func (gs *GameScene) ForEach(funcEach FuncForEach)
ForEach - for each all positions
func (*GameScene) ForEachAround ¶
func (gs *GameScene) ForEachAround(x, y int, funcEachAround FuncForEach)
ForEachAround - for each around positions
func (*GameScene) InitWithArr ¶
InitWithArr - init scene
func (*GameScene) InitWithArr2 ¶
InitWithArr2 - init scene
func (*GameScene) InitWithArr2Ex ¶
InitWithArr2Ex - init scene
func (*GameScene) RandReelsEx ¶
func (gs *GameScene) RandReelsEx(game IGame, plugin sgc7plugin.IPlugin, reelsName string, rpd *ReelsPosData, nums int) error
RandReelsEx - random with reels
func (*GameScene) RandReelsEx2 ¶
func (gs *GameScene) RandReelsEx2(game IGame, plugin sgc7plugin.IPlugin, reelsName string, rpd0 *ReelsPosData, rpd1 *ReelsPosData, nums int) error
RandReelsEx - random with reels
func (*GameScene) RandReelsEx3 ¶
func (gs *GameScene) RandReelsEx3(game IGame, plugin sgc7plugin.IPlugin, reelsName string, rpd0 *ReelsPosData, rpd1 *ReelsPosData, nums int) error
RandReelsEx3 - random with reels
func (*GameScene) RandReelsWithReelData ¶
func (gs *GameScene) RandReelsWithReelData(reels *ReelsData, plugin sgc7plugin.IPlugin) error
RandReels - random with reels
func (*GameScene) ReplaceSymbol ¶
ReplaceSymbol - replace a symbol
func (*GameScene) ResetReelIndex ¶
ResetReelIndex - reset reel with index
某些游戏里,可能会出现重新移动某一轴,这个就是移动某一轴的接口
type IGame ¶
type IGame interface { // NewPlugin - new a plugin NewPlugin() sgc7plugin.IPlugin // FreePlugin - free a plugin FreePlugin(plugin sgc7plugin.IPlugin) // NewPlayerState - new playerstate NewPlayerState() IPlayerState // SetVer - set server version SetVer(ver string) // GetConfig - get config GetConfig() *Config // Initialize - initialize PlayerState Initialize() IPlayerState // CheckStake - check stake CheckStake(stake *Stake) error // Play - play Play(plugin sgc7plugin.IPlugin, cmd string, param string, ps IPlayerState, stake *Stake, prs []*PlayResult) (*PlayResult, error) // AddGameMod - add a gamemod AddGameMod(gmod IGameMod) error // ResetConfig ResetConfig(cfg interface{}) }
IGame - game
type IGameMod ¶
type IGameMod interface { // GetName - get mode name GetName() string // OnPlay - on play OnPlay(game IGame, plugin sgc7plugin.IPlugin, cmd string, param string, ps IPlayerState, stake *Stake, prs []*PlayResult) (*PlayResult, error) }
IGameMod - game
type IPlayerState ¶
type IPlayerState interface { // SetPublic - set player public state SetPublic(pub interface{}) error // SetPrivate - set player private state SetPrivate(pri interface{}) error // SetPublicJson - set player public state SetPublicJson(pub string) error // SetPrivateJson - set player private state SetPrivateJson(pri string) error // GetPublic - get player public state GetPublic() interface{} // GetPrivate - get player private state GetPrivate() interface{} // GetPublicJson - set player public state GetPublicJson() string // GetPrivateJson - set player private state GetPrivateJson() string // SetCurGameMod - set current game module SetCurGameMod(gamemod string) // GetCurGameMod - get current game module GetCurGameMod() string }
IPlayerState - player state
type IVal ¶
type IVal interface { // Type - get type of IVal Type() string // ParseString - str -> IVal ParseString(str string) error // IsSame - return this == right IsSame(right IVal) bool // Int32 - return a int32 Int32() int32 // Int64 - return a int64 Int64() int64 // Int - return a int Int() int // Float32 - return a float32 Float32() float32 // Float64 - return a float64 Float64() float64 // String - return a string String() string // Int32Arr - return a []int32 Int32Arr() []int32 // Int64Arr - return a []int64 Int64Arr() []int64 // IntArr - return a []int IntArr() []int // Float32Arr - return a []float32 Float32Arr() []float32 // Float64Arr - return a []float64 Float64Arr() []float64 // StringArr - return a []string StringArr() []string }
IVal
func NewFloatVal ¶
type IntArrVal ¶
IntArrVal
func (*IntArrVal[T]) Float32Arr ¶
Float32Arr - return a []float32
func (*IntArrVal[T]) Float64Arr ¶
Float64Arr - return a []float64
func (*IntArrVal[T]) ParseString ¶
type IntVal ¶
IntVal
func (*IntVal[T]) Float32Arr ¶
Float32Arr - return a []float32
func (*IntVal[T]) Float64Arr ¶
Float64Arr - return a []float64
func (*IntVal[T]) ParseString ¶
type LineData ¶
type LineData struct {
Lines [][]int `json:"lines"`
}
LineData - line data
func LoadLine3JSON ¶
LoadLine3JSON - load json file
func LoadLine5JSON ¶
LoadLine5JSON - load json file
func LoadLine6JSON ¶
LoadLine6JSON - load json file
func LoadLineDataFromExcel ¶
LoadLineDataFromExcel - load xlsx file
type PayTables ¶
type PayTables struct { MapPay map[int][]int `json:"paytables"` MapSymbols map[string]int `json:"symbols"` }
PayTables - pay tables
func LoadPayTables15JSON ¶
LoadPayTables15JSON - load json file
func LoadPayTables25JSON ¶
LoadPayTables25JSON - load json file
func LoadPayTables3JSON ¶
LoadPayTables3JSON - load json file
func LoadPayTables5JSON ¶
LoadPayTables5JSON - load json file
func LoadPayTables6JSON ¶
LoadPayTables6JSON - load json file
func LoadPaytablesFromExcel ¶
LoadPaytablesFromExcel - load xlsx file
func (*PayTables) GetStringFromInt ¶
type PlayResult ¶
type PlayResult struct { CurGameMod string `json:"curgamemod"` CurGameModParams interface{} `json:"curgamemodparams"` NextGameMod string `json:"nextgamemod"` Scenes []*GameScene `json:"scenes"` OtherScenes []*GameScene `json:"otherscenes"` PrizeScenes []*GameScene `json:"prizescenes"` PrizeCoinWin int `json:"prizecoinwin"` PrizeCashWin int64 `json:"prizecashwin"` JackpotCoinWin int `json:"jackpotcoinwin"` JackpotCashWin int64 `json:"jackpotcashwin"` JackpotType int `json:"jackpottype"` Results []*Result `json:"results"` MulPos []int `json:"mulpos"` NextCmds []string `json:"-"` NextCmdParams []string `json:"-"` CoinWin int `json:"-"` CashWin int64 `json:"-"` IsFinish bool `json:"-"` IsWait bool `json:"-"` CurIndex int `json:"-"` ParentIndex int `json:"-"` ModType string `json:"-"` }
PlayResult - result for play
func JSON2PlayResult ¶
func JSON2PlayResult(buf []byte, pr *PlayResult) (*PlayResult, error)
JSON2PlayResult - json => PlayResult
func NewPlayResult ¶
func NewPlayResult(curGameMod string, curIndex int, parentIndex int, modType string) *PlayResult
NewPlayResult - new a PlayResult
func (*PlayResult) CountEndingSymbols ¶
func (pr *PlayResult) CountEndingSymbols(symbols []int) []int
CountEndingSymbols - count symbol number
type ReelsData ¶
type ReelsData struct {
Reels [][]int `json:"reels"`
}
ReelsData - reels data
func LoadReels3JSON ¶
LoadReels3JSON - load json file
func LoadReels5JSON ¶
LoadReels5JSON - load json file
func LoadReelsFromExcel ¶
LoadReelsFromExcel - load xlsx file
func LoadReelsFromExcel2 ¶
LoadReelsFromExcel2 - load xlsx file
func (*ReelsData) BuildReelsPosData ¶
func (rd *ReelsData) BuildReelsPosData(onpos FuncReelsDataPos) (*ReelsPosData, error)
BuildReelsPosData - 构建轮子坐标数据,一般用于后续的转轮算法,主要起到随机优化效率用
func (*ReelsData) DropDownIntoGameScene ¶
DropDownIntoGameScene - 用轮子当前位置处理下落
注意: 1. 这个接口需要特别注意,传入indexes是上一次用过的,所以实际用应该-1 2. 这个接口按道理只会对index做减法操作,所以不会考虑向下越界问题,只处理向上的越界
func (*ReelsData) DropDownIntoGameScene2 ¶
DropDownIntoGameScene2 - 用轮子当前位置处理下落
注意: 1. 这个接口需要特别注意,传入indexes是上一次用过的,所以实际用应该-1 2. 这个接口按道理只会对index做减法操作,所以不会考虑向下越界问题,只处理向上的越界
type ReelsPosData ¶
type ReelsPosData struct {
ReelsPos [][]int `json:"reelspos"`
}
ReelsPosData - reels position data
func NewReelsPosData ¶
func NewReelsPosData(reels *ReelsData) *ReelsPosData
func (*ReelsPosData) AddPos ¶
func (reelspos *ReelsPosData) AddPos(x, y int)
func (*ReelsPosData) RandReel ¶
func (reelspos *ReelsPosData) RandReel(ctx context.Context, plugin sgc7plugin.IPlugin, x int) (int, error)
type Result ¶
type Result struct { Type ResultType `json:"type"` LineIndex int `json:"lineindex"` Symbol int `json:"symbol"` Mul int `json:"mul"` CoinWin int `json:"coinwin"` CashWin int `json:"cashwin"` Pos []int `json:"pos"` OtherMul int `json:"othermul"` Wilds int `json:"wilds"` SymbolNums int `json:"symbolnums"` }
Result - result for slots game
func CalcClusterResult ¶
func CalcClusterResult(scene *GameScene, pt *PayTables, bet int, isValidSymbol FuncIsValidSymbol, isWild FuncIsWild, isSameSymbol FuncIsSameSymbol, getSymbol FuncGetSymbol) ([]*Result, error)
CalcClusterResult - cluster
func CalcFullLine ¶
func CalcFullLine(scene *GameScene, pt *PayTables, bet int, isValidSymbolEx FuncIsValidSymbolEx, isWild FuncIsWild, isSameSymbol FuncIsSameSymbol) []*Result
CalcFullLine - calc fullline & no wild in reel0
还是用算线的方式来计算全线游戏,效率会低一些,数据量也会大一些,但某些特殊类型的游戏只能这样计算 也没有考虑第一轴有wild的情况(后续可调整算法)
func CalcFullLineEx ¶
func CalcFullLineEx(scene *GameScene, pt *PayTables, bet int, isValidSymbolEx FuncIsValidSymbolEx, isWild FuncIsWild, isSameSymbol FuncIsSameSymbol) []*Result
CalcFullLineEx - calc fullline & no wild in reel0
用数个数的方式来计算全线游戏,第一轴不能有wild
func CalcFullLineEx2 ¶
func CalcFullLineEx2(scene *GameScene, pt *PayTables, bet int, isValidSymbolEx FuncIsValidSymbolEx, isWild FuncIsWild, isSameSymbol FuncIsSameSymbol) []*Result
CalcFullLineEx2 - calc fullline
用数个数的方式来计算全线游戏
func CalcLine ¶
func CalcLine(scene *GameScene, pt *PayTables, ld []int, bet int, isValidSymbol FuncIsValidSymbol, isWild FuncIsWild, isSameSymbol FuncIsSameSymbol, getSymbol FuncGetSymbol) *Result
CalcLine - calc line
func CalcLineEx ¶
func CalcLineEx(scene *GameScene, pt *PayTables, ld []int, bet int, isValidSymbol FuncIsValidSymbol, isWild FuncIsWild, isSameSymbol FuncIsSameSymbol, calcOtherMul FuncCalcOtherMul, getSymbol FuncGetSymbol) *Result
CalcLineEx - calc line
func CalcLineOtherMul ¶
func CalcLineOtherMul(scene *GameScene, pt *PayTables, ld []int, bet int, isValidSymbol FuncIsValidSymbol, isWild FuncIsWild, isSameSymbol FuncIsSameSymbol, calcOtherMul FuncCalcOtherMulEx, getSymbol FuncGetSymbol) *Result
CalcLineOtherMul - calc line with otherMul
func CalcScatter ¶
func CalcScatter(scene *GameScene, pt *PayTables, scatter int, bet int, coins int, isScatter FuncIsScatter) *Result
CalcScatter - calc scatter
func CalcScatter2 ¶
func CalcScatter2(scene *GameScene, pt *PayTables, scatter int, bet int, coins int, isScatter FuncIsScatter) *Result
CalcScatter2 - calc scatter
func CalcScatter3 ¶
func CalcScatter3(scene *GameScene, pt *PayTables, scatter int, bet int, coins int, isScatter FuncIsScatter, isOnlyOneOnReel bool) *Result
CalcScatter3 - calc scatter
func CalcScatter4 ¶
func CalcScatter4(scene *GameScene, pt *PayTables, scatter int, bet int, isScatter FuncIsScatter, isOnlyOneOnReel bool) *Result
CalcScatter4 - calc scatter
func CalcScatterEx ¶
func CalcScatterEx(scene *GameScene, scatter int, nums int, isScatter FuncIsScatter) *Result
CalcScatterEx - calc scatter
func CalcScatterOnReels ¶
func CalcScatterOnReels(scene *GameScene, scatter int, nums int, isScatter FuncIsScatter) *Result
CalcScatterOnReels - calc scatter
type StrVal ¶
type StrVal struct {
Val string `json:"val"`
}
StrVal
func (*StrVal) Float32Arr ¶
Float32Arr - return a []float32
func (*StrVal) Float64Arr ¶
Float64Arr - return a []float64
func (*StrVal) ParseString ¶
type StrValWeights ¶
StrValWeights
func LoadStrValWeightsFromExcel ¶
func LoadStrValWeightsFromExcel(fn string) (*StrValWeights, error)
LoadStrValWeightsFromExcel - load xlsx file
func NewStrValWeights ¶
func NewStrValWeights(vals []string, weights []int) (*StrValWeights, error)
func (*StrValWeights) Clone ¶
func (vw *StrValWeights) Clone() *StrValWeights
func (*StrValWeights) CloneExcludeVal ¶
func (vw *StrValWeights) CloneExcludeVal(val string) (*StrValWeights, error)
CloneExcludeVal - clone & exclude a val
func (*StrValWeights) RandIndex ¶
func (vw *StrValWeights) RandIndex(plugin sgc7plugin.IPlugin) (int, error)
func (*StrValWeights) RandVal ¶
func (vw *StrValWeights) RandVal(plugin sgc7plugin.IPlugin) (string, error)
type SymbolWeightReelData ¶
SymbolWeightReelData - symbol weight reel data
type SymbolWeightReels ¶
type SymbolWeightReels struct { Sets []*SymbolWeightReelsDataSet Width int }
SymbolWeightReels - symbol weight reels
func LoadSymbolWeightReels5JSON ¶
func LoadSymbolWeightReels5JSON(fn string) (*SymbolWeightReels, error)
LoadSymbolWeightReels5JSON - load json file
func (*SymbolWeightReels) RandomScene ¶
func (swr *SymbolWeightReels) RandomScene(gs *GameScene, plugin sgc7plugin.IPlugin, si1 int, si2 int, nocheck bool) error
RandomScene -
type SymbolWeightReelsData ¶
type SymbolWeightReelsData struct {
Reels []*SymbolWeightReelData
}
SymbolWeightReelsData - symbol weight reels data
type SymbolWeightReelsDataSet ¶
type SymbolWeightReelsDataSet struct {
Arr []*SymbolWeightReelsData
}
SymbolWeightReelsDataSet - symbol weight reels data
type ValArrMapping ¶
ValArrMapping
func LoadValArrMappingFromExcel ¶
func LoadValArrMappingFromExcel[T int, V int | int32 | int64](fn string, headerType string, headerVal string) (*ValArrMapping[T, V], error)
LoadValArrMappingFromExcel - load xlsx file
func NewValArrMapping ¶
func NewValArrMappingEx ¶
func NewValArrMappingEx[T int, V int | int32 | int64]() *ValArrMapping[T, V]
func (*ValArrMapping[T, V]) Clone ¶
func (vm *ValArrMapping[T, V]) Clone() *ValArrMapping[T, V]
func (*ValArrMapping[T, V]) Keys ¶
func (vm *ValArrMapping[T, V]) Keys() []T
type ValMapping ¶
ValMapping
func LoadValMappingFromExcel ¶
func LoadValMappingFromExcel[T int, V int | int32 | int64](fn string, headerType string, headerVal string) (*ValMapping[T, V], error)
LoadValMappingFromExcel - load xlsx file
func NewValMapping ¶
func NewValMappingEx ¶
func NewValMappingEx[T int, V int | int32 | int64]() *ValMapping[T, V]
func (*ValMapping[T, V]) Clone ¶
func (vm *ValMapping[T, V]) Clone() *ValMapping[T, V]
func (*ValMapping[T, V]) Keys ¶
func (vm *ValMapping[T, V]) Keys() []T
type ValMapping2 ¶
ValMapping2
func LoadValMapping2FromExcel ¶
func LoadValMapping2FromExcel(fn string, headerType string, headerVal string, funcNew FuncNewIVal) (*ValMapping2, error)
LoadValMapping2FromExcel - load xlsx file
func NewValMapping2 ¶
func NewValMapping2(typevals []int, vals []IVal) (*ValMapping2, error)
func NewValMappingEx2 ¶
func NewValMappingEx2() *ValMapping2
func (*ValMapping2) Clone ¶
func (vm *ValMapping2) Clone() *ValMapping2
func (*ValMapping2) Keys ¶
func (vm *ValMapping2) Keys() []int
type ValWeights ¶
type ValWeights struct { Vals []int `json:"vals"` Weights []int `json:"weights"` MaxWeight int `json:"maxWeight"` }
ValWeights
func LoadValWeightsFromExcel ¶
func LoadValWeightsFromExcel(fn string) (*ValWeights, error)
LoadValWeightsFromExcel - load xlsx file
func NewValWeights ¶
func NewValWeights(vals []int, weights []int) (*ValWeights, error)
func NewValWeightsEx ¶
func NewValWeightsEx() *ValWeights
func (*ValWeights) Add ¶
func (vw *ValWeights) Add(val int, weight int)
func (*ValWeights) ClearExcludeVal ¶
func (vw *ValWeights) ClearExcludeVal(val int)
func (*ValWeights) Clone ¶
func (vw *ValWeights) Clone() *ValWeights
func (*ValWeights) CloneExcludeVal ¶
func (vw *ValWeights) CloneExcludeVal(val int) (*ValWeights, error)
CloneExcludeVal - clone & exclude a val
func (*ValWeights) GetWeight ¶
func (vw *ValWeights) GetWeight(val int) int
func (*ValWeights) RandVal ¶
func (vw *ValWeights) RandVal(plugin sgc7plugin.IPlugin) (int, error)
func (*ValWeights) Reset ¶
func (vw *ValWeights) Reset(vals []int, weights []int)
func (*ValWeights) SortBy ¶
func (vw *ValWeights) SortBy(dst *ValWeights) error
type ValWeights2 ¶
type ValWeights2 struct { Vals []IVal `json:"vals"` Weights []int `json:"weights"` MaxWeight int `json:"maxWeight"` }
ValWeights2
func LoadValWeights2FromExcel ¶
func LoadValWeights2FromExcel(fn string, headerVal string, headerWeight string, funcNew FuncNewIVal) (*ValWeights2, error)
LoadValWeights2FromExcel - load xlsx file
func LoadValWeights2FromExcelWithSymbols ¶
func LoadValWeights2FromExcelWithSymbols(fn string, headerVal string, headerWeight string, paytables *PayTables) (*ValWeights2, error)
LoadValWeights2FromExcelWithSymbols - load xlsx file
func NewValWeights2 ¶
func NewValWeights2(vals []IVal, weights []int) (*ValWeights2, error)
func NewValWeights2Ex ¶
func NewValWeights2Ex() *ValWeights2
func (*ValWeights2) Add ¶
func (vw *ValWeights2) Add(val IVal, weight int)
func (*ValWeights2) ClearExcludeVal ¶
func (vw *ValWeights2) ClearExcludeVal(val IVal)
func (*ValWeights2) Clone ¶
func (vw *ValWeights2) Clone() *ValWeights2
func (*ValWeights2) CloneExcludeVal ¶
func (vw *ValWeights2) CloneExcludeVal(val IVal) (*ValWeights2, error)
CloneExcludeVal - clone & exclude a val
func (*ValWeights2) GetWeight ¶
func (vw *ValWeights2) GetWeight(val IVal) int
func (*ValWeights2) RandVal ¶
func (vw *ValWeights2) RandVal(plugin sgc7plugin.IPlugin) (IVal, error)
func (*ValWeights2) RemoveVal ¶
func (vw *ValWeights2) RemoveVal(val IVal) error
RemoveVal - remove a val
func (*ValWeights2) Reset ¶
func (vw *ValWeights2) Reset(vals []IVal, weights []int)
func (*ValWeights2) SortBy ¶
func (vw *ValWeights2) SortBy(dst *ValWeights2) error
Source Files ¶
- algorithm.go
- arrvalweights.go
- basedef.go
- basicgame.go
- basicgameconfig.go
- basicgamemod.go
- basicplayerstate.go
- cascading.go
- cluster.go
- config.go
- err.go
- excel.go
- fastreelsrandomsp.go
- floatval.go
- floatvalmapping.go
- igame.go
- igamemod.go
- intarrval.go
- intval.go
- iplayerstate.go
- ival.go
- linedata.go
- paytables.go
- playresult.go
- randutils.go
- reelsdata.go
- reelspos.go
- result.go
- scene.go
- strval.go
- strvalweights.go
- symbolweightreels.go
- valarrmapping.go
- valmapping.go
- valmapping2.go
- valweights.go
- valweights2.go