lowcode

package
v0.10.313 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AwardUnknow        int = 0
	AwardCash          int = 1
	AwardCollector     int = 2
	AwardRespinTimes   int = 3
	AwardGameMulti     int = 4
	AwardStepMulti     int = 5
	AwardInitMask      int = 6
	AwardTriggerRespin int = 7
)
View Source
const (
	WinTypeLines        = "lines"
	WinTypeWays         = "ways"
	WinTypeScatters     = "scatters"
	WinTypeCountScatter = "countscatter"

	BetTypeNormal   = "bet"
	BetTypeTotalBet = "totalBet"
)
View Source
const (
	LightningTypeVal = "val"
	LightningTypeMul = "mul"

	LightningFeatureCollector = "collector"
)
View Source
const (
	MaskTypeNone         int = 0
	MaskTypeSymbolInReel int = 1
)
View Source
const (
	OtherSceneFeatureUnknow       int = 0
	OtherSceneFeatureGameMulti    int = 1 // GameMulti,默认用乘法
	OtherSceneFeatureGameMultiSum int = 2 // GameMulti,默认用加法
	OtherSceneFeatureStepMulti    int = 3 // StepMulti,默认用乘法
	OtherSceneFeatureStepMultiSum int = 4 // StepMulti,默认用加法
)
View Source
const (
	GamePropWidth        = 1
	GamePropHeight       = 2
	GamePropCurPaytables = 3
	GamePropCurReels     = 4
	GamePropCurLineData  = 5

	GamePropStepMulti = 100
	GamePropGameMulti = 101

	GamePropNextComponent   = 200
	GamePropRespinComponent = 201
)
View Source
const DefaultCmd = "SPIN"
View Source
const (
	TagCurReels = "reels"
)

Variables

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

	// ErrMustHaveMainPaytables - must have main paytables
	ErrMustHaveMainPaytables = errors.New("must have main paytables")

	// ErrInvalidGameMod - invalid gamemod
	ErrInvalidGameMod = errors.New("invalid gamemod")

	// ErrInvalidComponent - invalid component
	ErrInvalidComponent = errors.New("invalid component")

	// ErrInvalidReels - invalid reels
	ErrInvalidReels = errors.New("invalid reels")

	// ErrInvalidSymbol - invalid symbol
	ErrInvalidSymbol = errors.New("invalid symbol")

	// ErrInvalidPaytables - invalid paytables
	ErrInvalidPaytables = errors.New("invalid paytables")

	// ErrInvalidGamePropertyString - invalid gameProperty string
	ErrInvalidGamePropertyString = errors.New("invalid gameProperty string")

	// ErrParseScript - parse script error
	ErrParseScript = errors.New("parse script error")
	// ErrNoFunctionInScript - no function in script
	ErrNoFunctionInScript = errors.New("no function in script")
	// ErrWrongFunctionInScript - wrong function in script
	ErrWrongFunctionInScript = errors.New("wrong function in script")

	// ErrIvalidComponentName - invalid component name
	ErrIvalidComponentName = errors.New("invalid component name")

	// ErrIvalidCurGameModParams - invalid CurGameModParams
	ErrIvalidCurGameModParams = errors.New("invalid CurGameModParams")

	// ErrIvalidPlayResultLength - invalid PlayResult Length
	ErrIvalidPlayResultLength = errors.New("invalid PlayResult Length")

	// ErrIvalidMultiLevelReelsConfig - invalid MultiLevelReels config
	ErrIvalidMultiLevelReelsConfig = errors.New("invalid MultiLevelReels config")

	// ErrIvalidStatsSymbolsInConfig - invalid StatsSymbols in config
	ErrIvalidStatsSymbolsInConfig = errors.New("invalid StatsSymbols in config")
	// ErrIvalidStatsComponentInConfig - invalid Stats's component in config
	ErrIvalidStatsComponentInConfig = errors.New("invalid Stats's component in config")

	// ErrIvalidGameData - invalid gameData
	ErrIvalidGameData = errors.New("invalid gameData")

	// ErrIvalidCmd - invalid cmd
	ErrIvalidCmd = errors.New("invalid cmd")
	// ErrIvalidCmdParam - invalid cmdparam
	ErrIvalidCmdParam = errors.New("invalid cmdparam")

	// ErrIvalidTagCurReels - invalid TagCurReels
	ErrIvalidTagCurReels = errors.New("invalid TagCurReels")
)
View Source
var MapProperty map[string]int

Functions

func GetBet

func GetBet(stake *sgc7game.Stake, bettype string) int

func NewStatsFeature

func NewStatsFeature(parent *sgc7stats.Feature, name string, onAnalyze sgc7stats.FuncAnalyzeFeature, width int, symbols []mathtoolset.SymbolType) *sgc7stats.Feature

func SetForceDisableStats

func SetForceDisableStats()

SetForceDisableStats - disable stats

func StartRTP

func StartRTP(gamecfg string, icore int, ispinnums int64, outputPath string) error

func String2Property

func String2Property(str string) (int, error)

Types

type Award added in v0.10.273

type Award struct {
	AwardType int
	Config    *AwardConfig
}

func NewArard added in v0.10.273

func NewArard(cfg *AwardConfig) *Award

type AwardConfig added in v0.10.273

type AwardConfig struct {
	AwardType string   `yaml:"awardType"`
	Val       int      `yaml:"val"`
	StrParam  string   `yaml:"strParam"`
	Vals      []int    `yaml:"vals"`
	StrParams []string `yaml:"strParams"`
}

func (*AwardConfig) GetType added in v0.10.273

func (cfg *AwardConfig) GetType() int

type BasicComponent

type BasicComponent struct {
	Config *BasicComponentConfig
	Name   string
}

func NewBasicComponent

func NewBasicComponent(name string) *BasicComponent

func (*BasicComponent) AddOtherScene

func (basicComponent *BasicComponent) AddOtherScene(gameProp *GameProperty, curpr *sgc7game.PlayResult,
	sc *sgc7game.GameScene, basicCD *BasicComponentData)

AddOtherScene -

func (*BasicComponent) AddRNG

func (basicComponent *BasicComponent) AddRNG(gameProp *GameProperty, rng int, basicCD *BasicComponentData)

AddRNG -

func (*BasicComponent) AddResult

func (basicComponent *BasicComponent) AddResult(curpr *sgc7game.PlayResult, ret *sgc7game.Result, basicCD *BasicComponentData)

AddResult -

func (*BasicComponent) AddScene

func (basicComponent *BasicComponent) AddScene(gameProp *GameProperty, curpr *sgc7game.PlayResult,
	sc *sgc7game.GameScene, basicCD *BasicComponentData)

AddScene -

func (*BasicComponent) EachUsedResults

func (basicComponent *BasicComponent) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*BasicComponent) GetName added in v0.10.285

func (basicComponent *BasicComponent) GetName() string

GetName -

func (*BasicComponent) GetTargetOtherScene

func (basicComponent *BasicComponent) GetTargetOtherScene(gameProp *GameProperty, curpr *sgc7game.PlayResult, basicCD *BasicComponentData) *sgc7game.GameScene

GetTargetOtherScene -

func (*BasicComponent) GetTargetScene

func (basicComponent *BasicComponent) GetTargetScene(gameProp *GameProperty, curpr *sgc7game.PlayResult, basicCD *BasicComponentData, targetScene string) *sgc7game.GameScene

GetTargetScene -

func (*BasicComponent) NewComponentData

func (basicComponent *BasicComponent) NewComponentData() IComponentData

NewComponentData -

func (*BasicComponent) OnNewGame

func (basicComponent *BasicComponent) OnNewGame(gameProp *GameProperty) error

OnNewGame -

func (*BasicComponent) OnNewStep

func (basicComponent *BasicComponent) OnNewStep(gameProp *GameProperty) error

OnNewStep -

func (*BasicComponent) OnPlayGameEnd added in v0.10.273

func (basicComponent *BasicComponent) OnPlayGameEnd(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

OnPlayGame - on playgame

func (*BasicComponent) OnStatsWithPB

func (basicComponent *BasicComponent) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

func (*BasicComponent) OnStatsWithPBBasicComponentData

func (basicComponent *BasicComponent) OnStatsWithPBBasicComponentData(feature *sgc7stats.Feature, pbComponent *sgc7pb.ComponentData, pr *sgc7game.PlayResult) int64

OnStatsWithComponent -

func (*BasicComponent) ReTagScene added in v0.10.267

func (basicComponent *BasicComponent) ReTagScene(gameProp *GameProperty, curpr *sgc7game.PlayResult,
	si int, basicCD *BasicComponentData)

ReTagScene -

type BasicComponentConfig

type BasicComponentConfig struct {
	DefaultNextComponent string   `yaml:"defaultNextComponent"` // next component, if it is empty jump to ending
	TagScenes            []string `yaml:"tagScenes"`            // tag scenes
	TagOtherScenes       []string `yaml:"tagOtherScenes"`       // tag otherScenes
	TargetScene          string   `yaml:"targetScene"`          // target scenes
	TargetOtherScene     string   `yaml:"targetOtherScene"`     // target otherscenes
	TagRNG               []string `yaml:"tagRNG"`               // tag RNG
}

type BasicComponentData

type BasicComponentData struct {
	UsedScenes            []int
	UsedOtherScenes       []int
	UsedResults           []int
	UsedPrizeScenes       []int
	CashWin               int64
	CoinWin               int
	TargetSceneIndex      int
	TargetOtherSceneIndex int
	RNG                   []int
}

func (*BasicComponentData) BuildPBBasicComponentData

func (basicComponentData *BasicComponentData) BuildPBBasicComponentData() *sgc7pb.ComponentData

BuildPBBasicComponentData

func (*BasicComponentData) BuildPBComponentData

func (basicComponentData *BasicComponentData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*BasicComponentData) OnNewGame

func (basicComponentData *BasicComponentData) OnNewGame()

OnNewGame -

func (*BasicComponentData) OnNewStep

func (basicComponentData *BasicComponentData) OnNewStep()

OnNewGame -

type BasicGameMod

type BasicGameMod struct {
	*sgc7game.BasicGameMod
	Pool       *GamePropertyPool
	Components *ComponentList
}

BasicGameMod - basic gamemod

func NewBasicGameMod

func NewBasicGameMod(pool *GamePropertyPool, cfgGameMod *GameModConfig, mgrComponent *ComponentMgr) *BasicGameMod

NewBasicGameMod - new BaseGame

func (*BasicGameMod) OnAsciiGame

func (bgm *BasicGameMod) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult) error

OnAsciiGame - outpur to asciigame

func (*BasicGameMod) OnNewGame

func (bgm *BasicGameMod) OnNewGame(gameProp *GameProperty) error

OnNewGame -

func (*BasicGameMod) OnNewStep

func (bgm *BasicGameMod) OnNewStep(gameProp *GameProperty) error

OnNewStep -

func (*BasicGameMod) OnPlay

func (bgm *BasicGameMod) OnPlay(game sgc7game.IGame, plugin sgc7plugin.IPlugin, cmd string, param string,
	ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult, gameData any) (*sgc7game.PlayResult, error)

OnPlay - on play

func (*BasicGameMod) ResetConfig

func (bgm *BasicGameMod) ResetConfig(cfg *Config)

ResetConfig

type BasicReels

type BasicReels struct {
	*BasicComponent
	Config         *BasicReelsConfig
	ReelSetWeights *sgc7game.ValWeights2
}

func (*BasicReels) Init

func (basicReels *BasicReels) Init(fn string, pool *GamePropertyPool) error

Init -

func (*BasicReels) OnAsciiGame

func (basicReels *BasicReels) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*BasicReels) OnPlayGame

func (basicReels *BasicReels) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*BasicReels) OnStats

func (basicReels *BasicReels) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

type BasicReelsConfig

type BasicReelsConfig struct {
	BasicComponentConfig `yaml:",inline"`
	ReelSetsWeight       string `yaml:"reelSetWeight"`
	ReelSet              string `yaml:"reelSet"`
	IsExpandReel         bool   `yaml:"isExpandReel"`
}

BasicReelsConfig - configuration for BasicReels

type BasicWins

type BasicWins struct {
	*BasicComponent
	Config         *BasicWinsConfig
	ExcludeSymbols []int
	WildSymbols    []int
}

func (*BasicWins) EachUsedResults added in v0.10.251

func (basicWins *BasicWins) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*BasicWins) Init

func (basicWins *BasicWins) Init(fn string, pool *GamePropertyPool) error

Init -

func (*BasicWins) NewComponentData added in v0.10.251

func (basicWins *BasicWins) NewComponentData() IComponentData

NewComponentData -

func (*BasicWins) OnAsciiGame

func (basicWins *BasicWins) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*BasicWins) OnPlayGame

func (basicWins *BasicWins) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*BasicWins) OnStats

func (basicWins *BasicWins) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*BasicWins) OnStatsWithPB added in v0.10.256

func (basicWins *BasicWins) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

func (*BasicWins) ProcTriggerFeature

func (basicWins *BasicWins) ProcTriggerFeature(tf *TriggerFeatureConfig, gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult, bwd *BasicWinsData) *sgc7game.Result

AddResult -

type BasicWinsConfig

type BasicWinsConfig struct {
	BasicComponentConfig `yaml:",inline"`
	MainType             string                  `yaml:"mainType"`       // lines or ways
	BetType              string                  `yaml:"betType"`        // bet or totalBet
	ExcludeSymbols       []string                `yaml:"excludeSymbols"` // w/s etc
	WildSymbols          []string                `yaml:"wildSymbols"`    // wild etc
	BeforMain            []*TriggerFeatureConfig `yaml:"beforMain"`      // befor the maintype
	AfterMain            []*TriggerFeatureConfig `yaml:"afterMain"`      // after the maintype
}

BasicWinsConfig - configuration for BasicWins

type BasicWinsData added in v0.10.251

type BasicWinsData struct {
	BasicComponentData
	NextComponent string
}

func (*BasicWinsData) BuildPBComponentData added in v0.10.251

func (basicWinsData *BasicWinsData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*BasicWinsData) OnNewGame added in v0.10.251

func (basicWinsData *BasicWinsData) OnNewGame()

OnNewGame -

func (*BasicWinsData) OnNewStep added in v0.10.251

func (basicWinsData *BasicWinsData) OnNewStep()

OnNewGame -

type BookOf

type BookOf struct {
	*BasicComponent
	Config          *BookOfConfig
	WeightTrigger   *sgc7game.ValWeights2
	WeightSymbolNum *sgc7game.ValWeights2
	WeightSymbol    *sgc7game.ValWeights2
}

func (*BookOf) EachUsedResults

func (bookof *BookOf) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*BookOf) Init

func (bookof *BookOf) Init(fn string, pool *GamePropertyPool) error

Init -

func (*BookOf) NewComponentData

func (bookof *BookOf) NewComponentData() IComponentData

NewComponentData -

func (*BookOf) OnAsciiGame

func (bookof *BookOf) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*BookOf) OnPlayGame

func (bookof *BookOf) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*BookOf) OnStats

func (bookof *BookOf) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*BookOf) OnStatsWithPB

func (bookof *BookOf) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type BookOfConfig

type BookOfConfig struct {
	BasicComponentConfig `yaml:",inline"`
	BetType              string `yaml:"betType"` // bet or totalBet
	ForceTrigger         bool   `yaml:"forceTrigger"`
	WeightTrigger        string `yaml:"weightTrigger"`
	WeightSymbolNum      string `yaml:"weightSymbolNum"`
	WeightSymbol         string `yaml:"weightSymbol"`
	ForceSymbolNum       int    `yaml:"forceSymbolNum"`
	SymbolRNG            string `yaml:"symbolRNG"` // 只在ForceSymbolNum为1时有效
}

BookOfConfig - configuration for BookOf feature

type BookOfData added in v0.10.273

type BookOfData struct {
	BasicComponentData
	Symbols []int
}

func (*BookOfData) BuildPBComponentData added in v0.10.273

func (bookOfData *BookOfData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*BookOfData) OnNewGame added in v0.10.273

func (bookOfData *BookOfData) OnNewGame()

OnNewGame -

func (*BookOfData) OnNewStep added in v0.10.273

func (bookOfData *BookOfData) OnNewStep()

OnNewGame -

type ChgSymbol added in v0.10.273

type ChgSymbol struct {
	*BasicComponent
	Config *ChgSymbolConfig
}

func (*ChgSymbol) Init added in v0.10.273

func (chgSymbol *ChgSymbol) Init(fn string, pool *GamePropertyPool) error

Init -

func (*ChgSymbol) OnAsciiGame added in v0.10.273

func (chgSymbol *ChgSymbol) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*ChgSymbol) OnPlayGame added in v0.10.273

func (chgSymbol *ChgSymbol) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*ChgSymbol) OnStats added in v0.10.273

func (chgSymbol *ChgSymbol) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

type ChgSymbolConfig added in v0.10.273

type ChgSymbolConfig struct {
	BasicComponentConfig `yaml:",inline"`
	Nodes                []*ChgSymbolNodeConfig `yaml:"nodes"`
}

ChgSymbolConfig - configuration for ChgSymbol feature

type ChgSymbolNodeConfig added in v0.10.273

type ChgSymbolNodeConfig struct {
	X          int    `yaml:"x"`
	Y          int    `yaml:"y"`
	Symbol     string `yaml:"symbol"`
	SymbolCode int    `yaml:"symbolCode"`
}

ChgSymbolNodeConfig -

type Collector

type Collector struct {
	*BasicComponent
	Config           *CollectorConfig
	SymbolCode       int
	PerLevelAwards   []*Award
	MapSPLevelAwards map[int][]*Award
}

func (*Collector) EachUsedResults

func (collector *Collector) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*Collector) Init

func (collector *Collector) Init(fn string, pool *GamePropertyPool) error

Init -

func (*Collector) NewComponentData

func (collector *Collector) NewComponentData() IComponentData

NewComponentData -

func (*Collector) OnAsciiGame

func (collector *Collector) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*Collector) OnNewGame

func (collector *Collector) OnNewGame(gameProp *GameProperty) error

OnNewGame - 因为 BasicComponent 考虑到效率,没有执行ComponentData的OnNewGame,所以这里需要特殊处理

func (*Collector) OnPlayGame

func (collector *Collector) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*Collector) OnStats

func (collector *Collector) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*Collector) OnStatsWithPB

func (collector *Collector) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type CollectorConfig

type CollectorConfig struct {
	BasicComponentConfig `yaml:",inline"`
	Symbol               string                 `yaml:"symbol"`
	MaxVal               int                    `yaml:"maxVal"`
	PerLevelAwards       []*AwardConfig         `yaml:"perLevelAwards"`
	MapSPLevelAwards     map[int][]*AwardConfig `yaml:"mapSPLevelAwards"`
}

CollectorConfig - configuration for Collector

type CollectorData

type CollectorData struct {
	BasicComponentData
	Val          int // 当前总值, Current total value
	NewCollector int // 这一个step收集到的, The values collected in this step
}

func (*CollectorData) BuildPBComponentData

func (collectorData *CollectorData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*CollectorData) OnNewGame

func (collectorData *CollectorData) OnNewGame()

OnNewGame -

func (*CollectorData) OnNewStep

func (collectorData *CollectorData) OnNewStep()

OnNewGame -

type ComponentConfig

type ComponentConfig struct {
	Name   string `yaml:"name"`
	Type   string `yaml:"type"`
	Config string `yaml:"config"`
}

type ComponentList

type ComponentList struct {
	Components    []IComponent
	MapComponents map[string]IComponent
}

func NewComponentList

func NewComponentList() *ComponentList

func (*ComponentList) AddComponent

func (lst *ComponentList) AddComponent(name string, component IComponent)

type ComponentMgr

type ComponentMgr struct {
	MapComponent map[string]FuncNewComponent
}

func NewComponentMgr

func NewComponentMgr() *ComponentMgr

func (*ComponentMgr) NewComponent

func (mgr *ComponentMgr) NewComponent(cfgComponent *ComponentConfig) IComponent

func (*ComponentMgr) Reg

func (mgr *ComponentMgr) Reg(component string, funcNew FuncNewComponent)

type Config

type Config struct {
	Name             string                         `yaml:"name"`
	Width            int                            `yaml:"width"`
	Height           int                            `yaml:"height"`
	Linedata         map[string]string              `yaml:"linedata"`
	MapLinedate      map[string]*sgc7game.LineData  `yaml:"-"`
	Paytables        map[string]string              `yaml:"paytables"`
	MapPaytables     map[string]*sgc7game.PayTables `yaml:"-"`
	IsIntReel        bool                           `yaml:"isIntReel"`
	Reels            map[string]string              `yaml:"reels"`
	MapReels         map[string]*sgc7game.ReelsData `yaml:"-"`
	SymbolsViewer    string                         `yaml:"symbolsViewer"`
	DefaultScene     string                         `yaml:"defaultScene"`
	DefaultPaytables string                         `yaml:"defaultPaytables"`
	DefaultLinedata  string                         `yaml:"defaultLinedata"`
	Bets             []int                          `yaml:"bets"`
	GameMods         []*GameModConfig               `yaml:"gamemods"`
	StatsSymbols     []string                       `yaml:"statsSymbols"`
	StatsSymbolCodes []mathtoolset.SymbolType       `yaml:"-"`
	Stats            *StatsConfig                   `yaml:"stats"`
	RTP              *RTPConfig                     `yaml:"rtp"`
	MainPath         string                         `yaml:"mainPath"`
	MapCmdComponent  map[string]string              `yaml:"mapCmdComponent"`
}

func LoadConfig

func LoadConfig(fn string) (*Config, error)

func (*Config) BuildStatsSymbolCodes

func (cfg *Config) BuildStatsSymbolCodes(paytables *sgc7game.PayTables) error

func (*Config) GetDefaultLineData

func (cfg *Config) GetDefaultLineData() *sgc7game.LineData

func (*Config) GetDefaultPaytables

func (cfg *Config) GetDefaultPaytables() *sgc7game.PayTables

func (*Config) GetPath added in v0.10.251

func (cfg *Config) GetPath(fn string) string

type FuncNewComponent

type FuncNewComponent func(name string) IComponent

type FuncOnEachUsedResult

type FuncOnEachUsedResult func(*sgc7game.Result)

type Game

type Game struct {
	*sgc7game.BasicGame
	Pool         *GamePropertyPool
	MgrComponent *ComponentMgr
}

Game - game

func NewGame

func NewGame(cfgfn string) (*Game, error)

NewGame - new a Game

func NewGameEx

func NewGameEx(cfgfn string, funcNewPlugin sgc7plugin.FuncNewPlugin) (*Game, error)

NewGame - new a Game

func (*Game) CheckStake

func (game *Game) CheckStake(stake *sgc7game.Stake) error

CheckStake - check stake

func (*Game) Init

func (game *Game) Init(cfgfn string) error

Init - initial game

func (*Game) NewGameData

func (game *Game) NewGameData() any

NewGameData - new GameData

func (*Game) NewPlayerState

func (game *Game) NewPlayerState() sgc7game.IPlayerState

NewPlayerState - new playerstate

func (*Game) OnAsciiGame

func (game *Game) OnAsciiGame(gameProp *GameProperty, stake *sgc7game.Stake, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult) error

OnAsciiGame - outpur to asciigame

func (*Game) ResetConfig

func (game *Game) ResetConfig(cfg any)

ResetConfig

type GameModConfig

type GameModConfig struct {
	Type       string             `yaml:"type"`
	Components []*ComponentConfig `yaml:"components"`
}

type GameParams

type GameParams struct {
	sgc7pb.GameParam `json:",inline"`
	LastScene        *sgc7game.GameScene `json:"-"`
	LastOtherScene   *sgc7game.GameScene `json:"-"`
}

func (*GameParams) AddComponentData

func (gp *GameParams) AddComponentData(name string, cd IComponentData) error

type GameProperty

type GameProperty struct {
	Pool             *GamePropertyPool
	MapVals          map[int]int
	MapStrVals       map[int]string
	CurPaytables     *sgc7game.PayTables
	CurLineData      *sgc7game.LineData
	CurReels         *sgc7game.ReelsData
	MapIntValWeights map[string]*sgc7game.ValWeights2
	MapStats         map[string]*sgc7stats.Feature

	MapComponentData  map[string]IComponentData
	HistoryComponents []IComponent
	RespinComponents  []string
	// contains filtered or unexported fields
}

func (*GameProperty) AddVal

func (gameProp *GameProperty) AddVal(prop int, val int) error

func (*GameProperty) BuildGameParam added in v0.10.285

func (gameProp *GameProperty) BuildGameParam(gp *GameParams)

func (*GameProperty) GetIntValWeights added in v0.10.251

func (gameProp *GameProperty) GetIntValWeights(fn string) (*sgc7game.ValWeights2, error)

func (*GameProperty) GetOtherScene

func (gameProp *GameProperty) GetOtherScene(pr *sgc7game.PlayResult, tag string) (*sgc7game.GameScene, int)

func (*GameProperty) GetScene

func (gameProp *GameProperty) GetScene(pr *sgc7game.PlayResult, tag string) (*sgc7game.GameScene, int)

func (*GameProperty) GetStrVal

func (gameProp *GameProperty) GetStrVal(prop int) string

func (*GameProperty) GetTagInt added in v0.10.251

func (gameProp *GameProperty) GetTagInt(tag string) int

func (*GameProperty) GetTagStr added in v0.10.267

func (gameProp *GameProperty) GetTagStr(tag string) string

func (*GameProperty) GetVal

func (gameProp *GameProperty) GetVal(prop int) int

func (*GameProperty) OnNewGame added in v0.10.285

func (gameProp *GameProperty) OnNewGame() error

func (*GameProperty) OnNewStep

func (gameProp *GameProperty) OnNewStep() error

func (*GameProperty) ProcMulti added in v0.10.290

func (gameProp *GameProperty) ProcMulti(ret *sgc7game.Result)

func (*GameProperty) ProcRespin added in v0.10.277

func (gameProp *GameProperty) ProcRespin(pr *sgc7game.PlayResult, gp *GameParams)

func (*GameProperty) Respin

func (gameProp *GameProperty) Respin(pr *sgc7game.PlayResult, gp *GameParams, respinComponent string, gs *sgc7game.GameScene, os *sgc7game.GameScene)

func (*GameProperty) SetStrVal

func (gameProp *GameProperty) SetStrVal(prop int, val string) error

func (*GameProperty) SetVal

func (gameProp *GameProperty) SetVal(prop int, val int) error

func (*GameProperty) TagInt added in v0.10.251

func (gameProp *GameProperty) TagInt(tag string, val int)

func (*GameProperty) TagOtherScene

func (gameProp *GameProperty) TagOtherScene(pr *sgc7game.PlayResult, tag string, sceneIndex int)

func (*GameProperty) TagScene

func (gameProp *GameProperty) TagScene(pr *sgc7game.PlayResult, tag string, sceneIndex int)

func (*GameProperty) TagStr added in v0.10.267

func (gameProp *GameProperty) TagStr(tag string, val string)

func (*GameProperty) TriggerRespin added in v0.10.275

func (gameProp *GameProperty) TriggerRespin(pr *sgc7game.PlayResult, gp *GameParams, respinNum int, respinComponent string) error

func (*GameProperty) TriggerRespinWithWeights added in v0.10.275

func (gameProp *GameProperty) TriggerRespinWithWeights(pr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin, fn string, respinComponent string) error

type GamePropertyPool

type GamePropertyPool struct {
	Pool             sync.Pool
	Config           *Config
	DefaultPaytables *sgc7game.PayTables
	DefaultLineData  *sgc7game.LineData
	SymbolsViewer    *SymbolsViewer
	MapSymbolColor   *asciigame.SymbolColorMap
	MapComponents    map[string]IComponent
	Stats            *Stats
}

func NewGamePropertyPool

func NewGamePropertyPool(cfgfn string) (*GamePropertyPool, error)

func (*GamePropertyPool) InitStats

func (pool *GamePropertyPool) InitStats() error

func (*GamePropertyPool) NewGameProp

func (pool *GamePropertyPool) NewGameProp() (*GameProperty, error)

func (*GamePropertyPool) NewStatsWithConfig

func (pool *GamePropertyPool) NewStatsWithConfig(parent *sgc7stats.Feature, cfg *StatsConfig) (*sgc7stats.Feature, error)

type IComponent

type IComponent interface {
	// Init -
	Init(fn string, pool *GamePropertyPool) error
	// OnNewGame -
	OnNewGame(gameProp *GameProperty) error
	// OnNewStep -
	OnNewStep(gameProp *GameProperty) error
	// OnPlayGame - on playgame
	OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
		cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error
	// OnAsciiGame - outpur to asciigame
	OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error
	// OnStats -
	OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)
	// NewComponentData -
	NewComponentData() IComponentData
	// OnStatsWithPB -
	OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)
	// EachUsedResults -
	EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)
	// OnPlayGame - on playgame
	OnPlayGameEnd(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
		cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error
	// GetName -
	GetName() string
}

func NewBasicReels

func NewBasicReels(name string) IComponent

func NewBasicWins

func NewBasicWins(name string) IComponent

func NewBookOf

func NewBookOf(name string) IComponent

func NewChgSymbol added in v0.10.273

func NewChgSymbol(name string) IComponent

func NewCollector

func NewCollector(name string) IComponent

func NewLightning

func NewLightning(name string) IComponent

func NewMask added in v0.10.285

func NewMask(name string) IComponent

func NewMultiLevelMystery

func NewMultiLevelMystery(name string) IComponent

func NewMultiLevelReels

func NewMultiLevelReels(name string) IComponent

func NewMultiLevelReplaceReel added in v0.10.308

func NewMultiLevelReplaceReel(name string) IComponent

func NewMultiRespin added in v0.10.279

func NewMultiRespin(name string) IComponent

func NewMystery

func NewMystery(name string) IComponent

func NewOverlaySymbol

func NewOverlaySymbol(name string) IComponent

func NewReelSetMystery added in v0.10.267

func NewReelSetMystery(name string) IComponent

func NewReplaceSymbol added in v0.10.285

func NewReplaceSymbol(name string) IComponent

func NewRespin added in v0.10.273

func NewRespin(name string) IComponent

func NewSymbolMulti

func NewSymbolMulti(name string) IComponent

func NewSymbolVal

func NewSymbolVal(name string) IComponent

func NewSymbolVal2

func NewSymbolVal2(name string) IComponent

func NewSymbolValWins

func NewSymbolValWins(name string) IComponent

func NewWeightTrigger added in v0.10.270

func NewWeightTrigger(name string) IComponent

type IComponentData

type IComponentData interface {
	// OnNewGame -
	OnNewGame()
	// OnNewStep -
	OnNewStep()
	// BuildPBComponentData
	BuildPBComponentData() proto.Message
}

type Lightning

type Lightning struct {
	*BasicComponent
	Config                   *LightningConfig
	SymbolCode               int
	Weight                   *sgc7game.ValWeights2
	MapSymbols               map[int]*LightningSymbolData
	MapSymbolTriggerFeatures map[int]*LightningTriggerFeatureConfig
	ValSymbolCode            int
	MulSymbolCode            int
	CollectorSymbolCode      int
}

func (*Lightning) EachUsedResults

func (lightning *Lightning) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*Lightning) Init

func (lightning *Lightning) Init(fn string, pool *GamePropertyPool) error

Init -

func (*Lightning) NewComponentData

func (lightning *Lightning) NewComponentData() IComponentData

NewComponentData -

func (*Lightning) OnAsciiGame

func (lightning *Lightning) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*Lightning) OnPlayGame

func (lightning *Lightning) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*Lightning) OnStats

func (lightning *Lightning) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*Lightning) OnStatsWithPB

func (lightning *Lightning) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type LightningConfig

type LightningConfig struct {
	BasicComponentConfig  `yaml:",inline"`
	Symbol                string                           `yaml:"symbol"`
	Weight                string                           `yaml:"weight"`
	SymbolVals            []*LightningSymbolValConfig      `yaml:"symbolVals"`
	SymbolTriggerFeatures []*LightningTriggerFeatureConfig `yaml:"symbolTriggerFeatures"`
	EndingFirstComponent  string                           `yaml:"endingFirstComponent"`
}

LightningConfig - configuration for Lightning

type LightningData

type LightningData struct {
	BasicComponentData
	Collector    int
	Val          int
	Mul          int
	NewConnector int
}

func (*LightningData) BuildPBComponentData

func (lightningData *LightningData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*LightningData) OnNewGame

func (lightningData *LightningData) OnNewGame()

OnNewGame -

func (*LightningData) OnNewStep

func (lightningData *LightningData) OnNewStep()

OnNewGame -

type LightningSymbolData

type LightningSymbolData struct {
	SymbolCode int
	Weight     *sgc7game.ValWeights2
	Config     *LightningSymbolValConfig
}

LightningSymbolData - symbol data for Lightning

type LightningSymbolValConfig

type LightningSymbolValConfig struct {
	Symbol string `yaml:"symbol"`
	Weight string `yaml:"weight"`
	Type   string `yaml:"type"` // like val or mul
}

LightningSymbolValConfig - configuration for symbol value

type LightningTriggerFeatureConfig

type LightningTriggerFeatureConfig struct {
	Symbol  string `yaml:"symbol"`  // like NEW_COLLECTOR
	Feature string `yaml:"feature"` // like collector
}

LightningTriggerFeatureConfig - configuration for lightning trigger feature

type Mask added in v0.10.285

type Mask struct {
	*BasicComponent
	Config          *MaskConfig
	MaskType        int
	SymbolCode      int
	PerMaskAwards   []*Award
	MapSPMaskAwards map[int][]*Award
}

func (*Mask) ChgMask added in v0.10.285

func (mask *Mask) ChgMask(gameProp *GameProperty, md *MaskData, curpr *sgc7game.PlayResult, gp *GameParams, curMask int, val bool, noProcSPLevel bool)

onMaskChg -

func (*Mask) EachUsedResults added in v0.10.285

func (mask *Mask) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*Mask) Init added in v0.10.285

func (mask *Mask) Init(fn string, pool *GamePropertyPool) error

Init -

func (*Mask) NewComponentData added in v0.10.285

func (mask *Mask) NewComponentData() IComponentData

NewComponentData -

func (*Mask) OnAsciiGame added in v0.10.285

func (mask *Mask) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*Mask) OnNewGame added in v0.10.285

func (mask *Mask) OnNewGame(gameProp *GameProperty) error

OnNewGame - 因为 BasicComponent 考虑到效率,没有执行ComponentData的OnNewGame,所以这里需要特殊处理

func (*Mask) OnPlayGame added in v0.10.285

func (mask *Mask) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*Mask) OnPlayGameEnd added in v0.10.285

func (mask *Mask) OnPlayGameEnd(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

OnPlayGame - on playgame

func (*Mask) OnStats added in v0.10.285

func (mask *Mask) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*Mask) OnStatsWithPB added in v0.10.285

func (mask *Mask) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

func (*Mask) ProcMask added in v0.10.297

func (mask *Mask) ProcMask(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, targetScene string)

onMaskChg -

type MaskConfig added in v0.10.285

type MaskConfig struct {
	BasicComponentConfig `yaml:",inline"`
	MaskType             string                 `yaml:"maskType"`
	Symbol               string                 `yaml:"symbol"`
	Num                  int                    `yaml:"num"`
	PerMaskAwards        []*AwardConfig         `yaml:"perMaskAwards"`
	MapSPMaskAwards      map[int][]*AwardConfig `yaml:"mapSPMaskAwards"` // -1表示全满的奖励
	EndingSPAward        string                 `yaml:"endingSPAward"`
}

MaskConfig - configuration for Mask

type MaskData added in v0.10.285

type MaskData struct {
	BasicComponentData
	Num      int
	Vals     []bool
	NewChged int
	NewVals  []bool
}

func (*MaskData) BuildPBComponentData added in v0.10.285

func (maskData *MaskData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*MaskData) IsFull added in v0.10.285

func (maskData *MaskData) IsFull() bool

OnNewGame -

func (*MaskData) OnNewGame added in v0.10.285

func (maskData *MaskData) OnNewGame()

OnNewGame -

func (*MaskData) OnNewStep added in v0.10.285

func (maskData *MaskData) OnNewStep()

OnNewGame -

type MultiLevelMystery

type MultiLevelMystery struct {
	*BasicComponent
	Config                   *MultiLevelMysteryConfig
	MapMysteryTriggerFeature map[int]*MysteryTriggerFeatureConfig
	LevelMysteryWeights      []*sgc7game.ValWeights2
	MysterySymbols           []int
}

func (*MultiLevelMystery) EachUsedResults

func (multiLevelMystery *MultiLevelMystery) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*MultiLevelMystery) Init

func (multiLevelMystery *MultiLevelMystery) Init(fn string, pool *GamePropertyPool) error

Init -

func (*MultiLevelMystery) NewComponentData

func (multiLevelMystery *MultiLevelMystery) NewComponentData() IComponentData

NewComponentData -

func (*MultiLevelMystery) OnAsciiGame

func (multiLevelMystery *MultiLevelMystery) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*MultiLevelMystery) OnNewGame

func (multiLevelMystery *MultiLevelMystery) OnNewGame(gameProp *GameProperty) error

OnNewGame -

func (*MultiLevelMystery) OnNewStep

func (multiLevelMystery *MultiLevelMystery) OnNewStep(gameProp *GameProperty) error

OnNewStep -

func (*MultiLevelMystery) OnPlayGame

func (multiLevelMystery *MultiLevelMystery) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*MultiLevelMystery) OnStats

func (multiLevelMystery *MultiLevelMystery) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*MultiLevelMystery) OnStatsWithPB

func (multiLevelMystery *MultiLevelMystery) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type MultiLevelMysteryConfig

type MultiLevelMysteryConfig struct {
	BasicComponentConfig   `yaml:",inline"`
	Mystery                string                          `yaml:"mystery"`
	Mysterys               []string                        `yaml:"mysterys"`
	Levels                 []*MultiLevelMysteryLevelConfig `yaml:"levels"`
	MysteryTriggerFeatures []*MysteryTriggerFeatureConfig  `yaml:"mysteryTriggerFeatures"`
}

MultiLevelMysteryConfig - configuration for MultiLevelMystery

type MultiLevelMysteryData

type MultiLevelMysteryData struct {
	BasicComponentData
	CurLevel       int
	CurMysteryCode int
}

func (*MultiLevelMysteryData) BuildPBComponentData

func (multiLevelMysteryData *MultiLevelMysteryData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*MultiLevelMysteryData) OnNewGame

func (multiLevelMysteryData *MultiLevelMysteryData) OnNewGame()

OnNewGame -

func (*MultiLevelMysteryData) OnNewStep

func (multiLevelMysteryData *MultiLevelMysteryData) OnNewStep()

OnNewGame -

type MultiLevelMysteryLevelConfig

type MultiLevelMysteryLevelConfig struct {
	MysteryWeight string `yaml:"mysteryWeight"`
	Collector     string `yaml:"collector"`
	CollectorVal  int    `yaml:"collectorVal"`
}

MultiLevelMysteryLevelConfig - configuration for MultiLevelMystery's Level

type MultiLevelReels

type MultiLevelReels struct {
	*BasicComponent
	Config              *MultiLevelReelsConfig
	LevelReelSetWeights []*sgc7game.ValWeights2
}

func (*MultiLevelReels) EachUsedResults

func (multiLevelReels *MultiLevelReels) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*MultiLevelReels) Init

func (multiLevelReels *MultiLevelReels) Init(fn string, pool *GamePropertyPool) error

Init -

func (*MultiLevelReels) NewComponentData

func (multiLevelReels *MultiLevelReels) NewComponentData() IComponentData

NewComponentData -

func (*MultiLevelReels) OnAsciiGame

func (multiLevelReels *MultiLevelReels) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*MultiLevelReels) OnNewGame

func (multiLevelReels *MultiLevelReels) OnNewGame(gameProp *GameProperty) error

OnNewGame -

func (*MultiLevelReels) OnNewStep

func (multiLevelReels *MultiLevelReels) OnNewStep(gameProp *GameProperty) error

OnNewStep -

func (*MultiLevelReels) OnPlayGame

func (multiLevelReels *MultiLevelReels) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*MultiLevelReels) OnStats

func (multiLevelReels *MultiLevelReels) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*MultiLevelReels) OnStatsWithPB

func (multiLevelReels *MultiLevelReels) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type MultiLevelReelsConfig

type MultiLevelReelsConfig struct {
	BasicComponentConfig `yaml:",inline"`
	Levels               []*MultiLevelReelsLevelConfig `yaml:"levels"`
}

MultiLevelReelsConfig - configuration for MultiLevelReels

type MultiLevelReelsData

type MultiLevelReelsData struct {
	BasicComponentData
	CurLevel int
}

func (*MultiLevelReelsData) BuildPBComponentData

func (multiLevelReelsData *MultiLevelReelsData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*MultiLevelReelsData) OnNewGame

func (multiLevelReelsData *MultiLevelReelsData) OnNewGame()

OnNewGame -

func (*MultiLevelReelsData) OnNewStep

func (multiLevelReelsData *MultiLevelReelsData) OnNewStep()

OnNewGame -

type MultiLevelReelsLevelConfig

type MultiLevelReelsLevelConfig struct {
	Reel           string `yaml:"reel"`
	ReelSetsWeight string `yaml:"reelSetWeight"`
	Collector      string `yaml:"collector"`
	CollectorVal   int    `yaml:"collectorVal"`
}

MultiLevelReelsLevelConfig - configuration for MultiLevelReels's Level

type MultiLevelReplaceReel added in v0.10.308

type MultiLevelReplaceReel struct {
	*BasicComponent
	Config *MultiLevelReplaceReelDataConfig
}

func (*MultiLevelReplaceReel) EachUsedResults added in v0.10.308

func (multiLevelReplaceReel *MultiLevelReplaceReel) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*MultiLevelReplaceReel) Init added in v0.10.308

func (multiLevelReplaceReel *MultiLevelReplaceReel) Init(fn string, pool *GamePropertyPool) error

Init -

func (*MultiLevelReplaceReel) NewComponentData added in v0.10.308

func (multiLevelReplaceReel *MultiLevelReplaceReel) NewComponentData() IComponentData

NewComponentData -

func (*MultiLevelReplaceReel) OnAsciiGame added in v0.10.308

func (multiLevelReplaceReel *MultiLevelReplaceReel) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*MultiLevelReplaceReel) OnNewGame added in v0.10.308

func (multiLevelReplaceReel *MultiLevelReplaceReel) OnNewGame(gameProp *GameProperty) error

OnNewGame -

func (*MultiLevelReplaceReel) OnNewStep added in v0.10.308

func (multiLevelReplaceReel *MultiLevelReplaceReel) OnNewStep(gameProp *GameProperty) error

OnNewStep -

func (*MultiLevelReplaceReel) OnPlayGame added in v0.10.308

func (multiLevelReplaceReel *MultiLevelReplaceReel) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*MultiLevelReplaceReel) OnStats added in v0.10.308

func (multiLevelReplaceReel *MultiLevelReplaceReel) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*MultiLevelReplaceReel) OnStatsWithPB added in v0.10.308

func (multiLevelReplaceReel *MultiLevelReplaceReel) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type MultiLevelReplaceReelData added in v0.10.308

type MultiLevelReplaceReelData struct {
	BasicComponentData
	CurLevel int
}

func (*MultiLevelReplaceReelData) BuildPBComponentData added in v0.10.308

func (multiLevelReplaceReelData *MultiLevelReplaceReelData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*MultiLevelReplaceReelData) OnNewGame added in v0.10.308

func (multiLevelReplaceReelData *MultiLevelReplaceReelData) OnNewGame()

OnNewGame -

func (*MultiLevelReplaceReelData) OnNewStep added in v0.10.308

func (multiLevelReplaceReelData *MultiLevelReplaceReelData) OnNewStep()

OnNewGame -

type MultiLevelReplaceReelDataConfig added in v0.10.308

type MultiLevelReplaceReelDataConfig struct {
	BasicComponentConfig `yaml:",inline"`
	Levels               []*MultiLevelReplaceReelLevelConfig `yaml:"levels"`
}

MultiLevelReplaceReelDataConfig - configuration for MultiLevelReplaceReelData

type MultiLevelReplaceReelLevelConfig added in v0.10.308

type MultiLevelReplaceReelLevelConfig struct {
	Reels           map[int][]string `yaml:"reels"` // x - [0, width)
	SymbolCodeReels map[int][]int    `yaml:"-"`
	Collector       string           `yaml:"collector"`
	CollectorVal    int              `yaml:"collectorVal"`
}

MultiLevelReplaceReelLevelConfig - configuration for MultiLevelReplaceReelData's Level

type MultiRespin added in v0.10.279

type MultiRespin struct {
	*BasicComponent
	Config *MultiRespinConfig
}

func (*MultiRespin) Init added in v0.10.279

func (multiRespin *MultiRespin) Init(fn string, pool *GamePropertyPool) error

Init -

func (*MultiRespin) OnAsciiGame added in v0.10.279

func (multiRespin *MultiRespin) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*MultiRespin) OnPlayGame added in v0.10.279

func (multiRespin *MultiRespin) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*MultiRespin) OnStats added in v0.10.279

func (multiRespin *MultiRespin) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

type MultiRespinConfig added in v0.10.279

type MultiRespinConfig struct {
	BasicComponentConfig `yaml:",inline"`
	RespinData           []*RespinDataConfig `yaml:"respinData"`      // wait player select
	TargetSymbolNum      string              `yaml:"targetSymbolNum"` // 这里可以用到一个前面记下的tagSymbolNum值
}

BasicWinsConfig - configuration for BasicWins

type Mystery

type Mystery struct {
	*BasicComponent
	Config                   *MysteryConfig
	MysteryWeights           *sgc7game.ValWeights2
	MysterySymbols           []int
	MapMysteryTriggerFeature map[int]*MysteryTriggerFeatureConfig
}

func (*Mystery) EachUsedResults

func (mystery *Mystery) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*Mystery) Init

func (mystery *Mystery) Init(fn string, pool *GamePropertyPool) error

Init -

func (*Mystery) NewComponentData

func (mystery *Mystery) NewComponentData() IComponentData

NewComponentData -

func (*Mystery) OnAsciiGame

func (mystery *Mystery) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*Mystery) OnPlayGame

func (mystery *Mystery) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*Mystery) OnStats

func (mystery *Mystery) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*Mystery) OnStatsWithPB

func (mystery *Mystery) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type MysteryConfig

type MysteryConfig struct {
	BasicComponentConfig   `yaml:",inline"`
	MysteryRNG             string                         `yaml:"mysteryRNG"` // 强制用已经使用的随机数结果做 Mystery
	MysteryWeight          string                         `yaml:"mysteryWeight"`
	Mystery                string                         `yaml:"mystery"`
	Mysterys               []string                       `yaml:"mysterys"`
	MysteryTriggerFeatures []*MysteryTriggerFeatureConfig `yaml:"mysteryTriggerFeatures"`
}

MysteryConfig - configuration for Mystery

type MysteryData

type MysteryData struct {
	BasicComponentData
	CurMysteryCode int
}

func (*MysteryData) BuildPBComponentData

func (mysteryData *MysteryData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*MysteryData) OnNewGame

func (mysteryData *MysteryData) OnNewGame()

OnNewGame -

func (*MysteryData) OnNewStep

func (mysteryData *MysteryData) OnNewStep()

OnNewGame -

type MysteryTriggerFeatureConfig

type MysteryTriggerFeatureConfig struct {
	Symbol               string `yaml:"symbol"`               // like LIGHTNING
	RespinFirstComponent string `yaml:"respinFirstComponent"` // like lightning
}

MysteryTriggerFeatureConfig - configuration for mystery trigger feature

type OtherSceneFeature added in v0.10.285

type OtherSceneFeature struct {
	Type   int
	Config *OtherSceneFeatureConfig
}

func NewOtherSceneFeature added in v0.10.285

func NewOtherSceneFeature(cfg *OtherSceneFeatureConfig) *OtherSceneFeature

type OtherSceneFeatureConfig added in v0.10.285

type OtherSceneFeatureConfig struct {
	Type string `yaml:"type"`
}

func (*OtherSceneFeatureConfig) GetType added in v0.10.285

func (cfg *OtherSceneFeatureConfig) GetType() int

type OverlaySymbol

type OverlaySymbol struct {
	*BasicComponent
	Config      *OverlaySymbolConfig
	SymbolCode  int
	MapPosition *sgc7game.ValMapping2
}

func (*OverlaySymbol) EachUsedResults

func (overlaySymbol *OverlaySymbol) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*OverlaySymbol) Init

func (overlaySymbol *OverlaySymbol) Init(fn string, pool *GamePropertyPool) error

Init -

func (*OverlaySymbol) NewComponentData

func (overlaySymbol *OverlaySymbol) NewComponentData() IComponentData

NewComponentData -

func (*OverlaySymbol) OnAsciiGame

func (overlaySymbol *OverlaySymbol) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*OverlaySymbol) OnNewGame

func (overlaySymbol *OverlaySymbol) OnNewGame(gameProp *GameProperty) error

OnNewGame -

func (*OverlaySymbol) OnNewStep

func (overlaySymbol *OverlaySymbol) OnNewStep(gameProp *GameProperty) error

OnNewStep -

func (*OverlaySymbol) OnPlayGame

func (overlaySymbol *OverlaySymbol) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*OverlaySymbol) OnStats

func (overlaySymbol *OverlaySymbol) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*OverlaySymbol) OnStatsWithPB

func (overlaySymbol *OverlaySymbol) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type OverlaySymbolConfig

type OverlaySymbolConfig struct {
	BasicComponentConfig `yaml:",inline"`
	Symbol               string `yaml:"symbol"`
	MapPosition          string `yaml:"mapPosition"`
	DefaultLevel         int    `yaml:"defaultLevel"`
	Collector            string `yaml:"collector"`
}

OverlaySymbolConfig - configuration for OverlaySymbol feature

type OverlaySymbolData

type OverlaySymbolData struct {
	BasicComponentData
	CurLevel int
}

func (*OverlaySymbolData) BuildPBComponentData

func (overlaySymbolData *OverlaySymbolData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*OverlaySymbolData) OnNewGame

func (overlaySymbolData *OverlaySymbolData) OnNewGame()

OnNewGame -

func (*OverlaySymbolData) OnNewStep

func (overlaySymbolData *OverlaySymbolData) OnNewStep()

OnNewGame -

type RTPConfig

type RTPConfig struct {
	Modules         []*RTPSymbolModule   `yaml:"modules"`
	HitRateFeatures []*RTPHitRateFeature `yaml:"hitRateFeatures"`
}

type RTPHitRateFeature

type RTPHitRateFeature struct {
	Name       string   `yaml:"name"`
	Components []string `yaml:"components"`
}

type RTPSymbolFeature

type RTPSymbolFeature struct {
	Name       string   `yaml:"name"`
	Components []string `yaml:"components"`
}

type RTPSymbolModule

type RTPSymbolModule struct {
	Name       string              `yaml:"name"`
	Components []string            `yaml:"components"`
	Features   []*RTPSymbolFeature `yaml:"features"`
}

type ReelSetMystery added in v0.10.267

type ReelSetMystery struct {
	*BasicComponent
	Config             *ReelSetMysteryConfig
	MapMysteryWeights  map[string]*sgc7game.ValWeights2
	MysterySymbolCodes []int
}

func (*ReelSetMystery) EachUsedResults added in v0.10.267

func (reelSetMystery *ReelSetMystery) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*ReelSetMystery) Init added in v0.10.267

func (reelSetMystery *ReelSetMystery) Init(fn string, pool *GamePropertyPool) error

Init -

func (*ReelSetMystery) NewComponentData added in v0.10.267

func (reelSetMystery *ReelSetMystery) NewComponentData() IComponentData

NewComponentData -

func (*ReelSetMystery) OnAsciiGame added in v0.10.267

func (reelSetMystery *ReelSetMystery) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*ReelSetMystery) OnPlayGame added in v0.10.267

func (reelSetMystery *ReelSetMystery) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*ReelSetMystery) OnStats added in v0.10.267

func (reelSetMystery *ReelSetMystery) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*ReelSetMystery) OnStatsWithPB added in v0.10.267

func (reelSetMystery *ReelSetMystery) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type ReelSetMysteryConfig added in v0.10.267

type ReelSetMysteryConfig struct {
	BasicComponentConfig `yaml:",inline"`
	MysteryRNG           string            `yaml:"mysteryRNG"` // 强制用已经使用的随机数结果做 ReelSetMystery
	MysterySymbols       []string          `yaml:"mysterySymbols"`
	MapMysteryWeight     map[string]string `yaml:"mapMysteryWeight"`
}

ReelSetMysteryConfig - configuration for ReelSetMystery

type ReelSetMysteryData added in v0.10.267

type ReelSetMysteryData struct {
	BasicComponentData
	CurMysteryCode int
}

func (*ReelSetMysteryData) BuildPBComponentData added in v0.10.267

func (reelSetMysteryData *ReelSetMysteryData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*ReelSetMysteryData) OnNewGame added in v0.10.267

func (reelSetMysteryData *ReelSetMysteryData) OnNewGame()

OnNewGame -

func (*ReelSetMysteryData) OnNewStep added in v0.10.267

func (reelSetMysteryData *ReelSetMysteryData) OnNewStep()

OnNewGame -

type ReplaceSymbol added in v0.10.285

type ReplaceSymbol struct {
	*BasicComponent
	Config                *ReplaceSymbolConfig
	SymbolCodes           []int
	Chg2SymbolCodeInReels []int
}

func (*ReplaceSymbol) Init added in v0.10.285

func (replaceSymbol *ReplaceSymbol) Init(fn string, pool *GamePropertyPool) error

Init -

func (*ReplaceSymbol) OnAsciiGame added in v0.10.285

func (replaceSymbol *ReplaceSymbol) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*ReplaceSymbol) OnPlayGame added in v0.10.285

func (replaceSymbol *ReplaceSymbol) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*ReplaceSymbol) OnStats added in v0.10.285

func (replaceSymbol *ReplaceSymbol) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

type ReplaceSymbolConfig added in v0.10.285

type ReplaceSymbolConfig struct {
	BasicComponentConfig `yaml:",inline"`
	Symbols              []string `yaml:"symbols"`
	Chg2SymbolInReels    []string `yaml:"chg2SymbolInReels"`
	Mask                 string   `yaml:"mask"`
}

ReplaceSymbolConfig - configuration for ReplaceSymbol

type Respin added in v0.10.273

type Respin struct {
	*BasicComponent
	Config *RespinConfig
}

func (*Respin) AddRespinTimes added in v0.10.273

func (respin *Respin) AddRespinTimes(gameProp *GameProperty, num int) error

OnPlayGame - on playgame

func (*Respin) EachUsedResults added in v0.10.273

func (respin *Respin) EachUsedResults(pr *sgc7game.PlayResult, pbComponentData *anypb.Any, oneach FuncOnEachUsedResult)

EachUsedResults -

func (*Respin) Init added in v0.10.273

func (respin *Respin) Init(fn string, pool *GamePropertyPool) error

Init -

func (*Respin) NewComponentData added in v0.10.273

func (respin *Respin) NewComponentData() IComponentData

NewComponentData -

func (*Respin) OnAsciiGame added in v0.10.273

func (respin *Respin) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*Respin) OnPlayGame added in v0.10.273

func (respin *Respin) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*Respin) OnPlayGameEnd added in v0.10.273

func (respin *Respin) OnPlayGameEnd(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

OnPlayGame - on playgame

func (*Respin) OnStats added in v0.10.273

func (respin *Respin) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

func (*Respin) OnStatsWithPB added in v0.10.273

func (respin *Respin) OnStatsWithPB(feature *sgc7stats.Feature, pbComponentData *anypb.Any, pr *sgc7game.PlayResult) (int64, error)

OnStatsWithPB -

type RespinConfig added in v0.10.273

type RespinConfig struct {
	BasicComponentConfig `yaml:",inline"`
	DefaultRespinNum     int    `yaml:"defaultRespinNum"`
	MainComponent        string `yaml:"mainComponent"`
}

RespinConfig - configuration for Respin

type RespinData added in v0.10.273

type RespinData struct {
	BasicComponentData
	LastRespinNum   int
	TotalRespinNum  int
	CurRespinNum    int
	CurAddRespinNum int
	TotalCoinWin    int64
	TotalCashWin    int64
}

func (*RespinData) BuildPBComponentData added in v0.10.273

func (respinData *RespinData) BuildPBComponentData() proto.Message

BuildPBComponentData

func (*RespinData) OnNewGame added in v0.10.273

func (respinData *RespinData) OnNewGame()

OnNewGame -

func (*RespinData) OnNewStep added in v0.10.273

func (respinData *RespinData) OnNewStep()

OnNewGame -

type RespinDataCmdParam added in v0.10.279

type RespinDataCmdParam struct {
	RespinNum       int    `json:"RespinNum"`       // respin number
	RespinComponent string `json:"respinComponent"` // like fg-spin
}

type RespinDataConfig added in v0.10.279

type RespinDataConfig struct {
	RespinNum                     int            `yaml:"respinNum"`                     // respin number
	RespinNumWeight               string         `yaml:"respinNumWeight"`               // respin number weight
	RespinNumWithScatterNum       map[int]int    `yaml:"respinNumWithScatterNum"`       // respin number with scatter number
	RespinNumWeightWithScatterNum map[int]string `yaml:"respinNumWeightWithScatterNum"` // respin number weight with scatter number
	RespinComponent               string         `yaml:"respinComponent"`               // like fg-spin
	Cmd                           string         `yaml:"cmd"`                           // cmd
}

RespinDataConfig - configuration for MultiRespin

type ScriptCore

type ScriptCore struct {
	Cel *cel.Env
}

func NewScriptCore

func NewScriptCore(gameProp *GameProperty) (*ScriptCore, error)

type Stats

type Stats struct {
	Root *sgc7stats.Feature

	TotalNum int64
	// contains filtered or unexported fields
}

func NewStats

func NewStats(root *sgc7stats.Feature) *Stats

func (*Stats) Push

func (stats *Stats) Push(stake *sgc7game.Stake, results []*sgc7game.PlayResult)

func (*Stats) StartWorker

func (stats *Stats) StartWorker()

func (*Stats) Wait

func (stats *Stats) Wait()

type StatsConfig

type StatsConfig struct {
	Name      string         `yaml:"name"`
	Component string         `yaml:"component"`
	Children  []*StatsConfig `yaml:"children"`
}

type StatsParam

type StatsParam struct {
	Stake   *sgc7game.Stake
	Results []*sgc7game.PlayResult
}

type SymbolMulti

type SymbolMulti struct {
	*BasicComponent
	Config            *SymbolMultiConfig
	SymbolCodes       []int
	WeightMulti       *sgc7game.ValWeights2
	OtherSceneFeature *OtherSceneFeature
}

func (*SymbolMulti) Init

func (symbolMulti *SymbolMulti) Init(fn string, pool *GamePropertyPool) error

Init -

func (*SymbolMulti) OnAsciiGame

func (symbolMulti *SymbolMulti) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*SymbolMulti) OnPlayGame

func (symbolMulti *SymbolMulti) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*SymbolMulti) OnStats

func (symbolMulti *SymbolMulti) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

type SymbolMultiConfig

type SymbolMultiConfig struct {
	BasicComponentConfig `yaml:",inline"`
	Symbol               string                   `yaml:"symbol"`
	Symbols              []string                 `yaml:"symbols"`
	WeightMulti          string                   `yaml:"weightMulti"`
	OtherSceneFeature    *OtherSceneFeatureConfig `yaml:"otherSceneFeature"`
}

SymbolMultiConfig - configuration for SymbolMulti feature

type SymbolVal

type SymbolVal struct {
	*BasicComponent
	Config            *SymbolValConfig
	SymbolCode        int
	WeightVal         *sgc7game.ValWeights2
	OtherSceneFeature *OtherSceneFeature
}

func (*SymbolVal) Init

func (symbolVal *SymbolVal) Init(fn string, pool *GamePropertyPool) error

Init -

func (*SymbolVal) OnAsciiGame

func (symbolVal *SymbolVal) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*SymbolVal) OnPlayGame

func (symbolVal *SymbolVal) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*SymbolVal) OnStats

func (symbolVal *SymbolVal) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

type SymbolVal2

type SymbolVal2 struct {
	*BasicComponent
	Config            *SymbolVal2Config
	SymbolCode        int
	WeightsVal        []*sgc7game.ValWeights2
	WeightSet         *sgc7game.ValWeights2
	OtherSceneFeature *OtherSceneFeature
}

func (*SymbolVal2) Init

func (symbolVal2 *SymbolVal2) Init(fn string, pool *GamePropertyPool) error

Init -

func (*SymbolVal2) OnAsciiGame

func (symbolVal2 *SymbolVal2) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*SymbolVal2) OnPlayGame

func (symbolVal2 *SymbolVal2) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*SymbolVal2) OnStats

func (symbolVal2 *SymbolVal2) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

type SymbolVal2Config

type SymbolVal2Config struct {
	BasicComponentConfig `yaml:",inline"`
	Symbol               string                   `yaml:"symbol"`
	WeightSet            string                   `yaml:"weightSet"`
	WeightsVal           []string                 `yaml:"weightsVal"`
	DefaultVal           int                      `yaml:"defaultVal"`
	RNGSet               string                   `yaml:"RNGSet"`
	OtherSceneFeature    *OtherSceneFeatureConfig `yaml:"otherSceneFeature"`
}

SymbolVal2Config - configuration for SymbolVal2 feature

type SymbolValConfig

type SymbolValConfig struct {
	BasicComponentConfig `yaml:",inline"`
	Symbol               string                   `yaml:"symbol"`
	WeightVal            string                   `yaml:"weightVal"`
	DefaultVal           int                      `yaml:"defaultVal"`
	OtherSceneFeature    *OtherSceneFeatureConfig `yaml:"otherSceneFeature"`
}

SymbolValConfig - configuration for SymbolMulti feature

type SymbolValWins

type SymbolValWins struct {
	*BasicComponent
	Config            *SymbolValWinsConfig
	TriggerSymbolCode int
}

func (*SymbolValWins) Init

func (symbolValWins *SymbolValWins) Init(fn string, pool *GamePropertyPool) error

Init -

func (*SymbolValWins) OnAsciiGame

func (symbolValWins *SymbolValWins) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*SymbolValWins) OnPlayGame

func (symbolValWins *SymbolValWins) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*SymbolValWins) OnStats

func (symbolValWins *SymbolValWins) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

type SymbolValWinsConfig

type SymbolValWinsConfig struct {
	BasicComponentConfig    `yaml:",inline"`
	BetType                 string `yaml:"betType"`                 // bet or totalBet
	TriggerSymbol           string `yaml:"triggerSymbol"`           // like collect
	Type                    string `yaml:"type"`                    // like scatters
	MinNum                  int    `yaml:"minNum"`                  // like 3
	IsTriggerSymbolNumMulti bool   `yaml:"isTriggerSymbolNumMulti"` // totalwins = totalvals * triggetSymbol's num
}

SymbolValWinsConfig - configuration for SymbolValWins

type SymbolViewerData

type SymbolViewerData struct {
	Code   int
	Symbol string
	Output string
	Color  string
}

type SymbolsViewer

type SymbolsViewer struct {
	MapSymbols map[int]*SymbolViewerData
}

func LoadSymbolsViewer

func LoadSymbolsViewer(fn string) (*SymbolsViewer, error)

type TriggerFeatureConfig

type TriggerFeatureConfig struct {
	TargetScene                   string         `yaml:"targetScene"`                   // like basicReels.mstery
	Symbol                        string         `yaml:"symbol"`                        // like scatter
	Type                          string         `yaml:"type"`                          // like scatters
	MinNum                        int            `yaml:"minNum"`                        // like 3
	Scripts                       string         `yaml:"scripts"`                       // scripts
	RespinNum                     int            `yaml:"respinNum"`                     // respin number
	RespinNumWeight               string         `yaml:"respinNumWeight"`               // respin number weight
	RespinNumWithScatterNum       map[int]int    `yaml:"respinNumWithScatterNum"`       // respin number with scatter number
	RespinNumWeightWithScatterNum map[int]string `yaml:"respinNumWeightWithScatterNum"` // respin number weight with scatter number
	BetType                       string         `yaml:"betType"`                       // bet or totalBet
	RespinComponent               string         `yaml:"respinComponent"`               // like fg-spin
	NextComponent                 string         `yaml:"nextComponent"`                 // next component
	TagSymbolNum                  string         `yaml:"tagSymbolNum"`                  // 这里可以将symbol数量记下来,别的地方能获取到
	AwardsCfg                     []*AwardConfig `yaml:"awards"`                        // 新的奖励系统
	Awards                        []*Award       `yaml:"-"`                             // 新的奖励系统
}

TriggerFeatureConfig - configuration for trigger feature

type WeightTrigger added in v0.10.270

type WeightTrigger struct {
	*BasicComponent
	Config    *WeightTriggerConfig
	WeightSet *sgc7game.ValWeights2
}

func (*WeightTrigger) Init added in v0.10.270

func (weightTrigger *WeightTrigger) Init(fn string, pool *GamePropertyPool) error

Init -

func (*WeightTrigger) OnAsciiGame added in v0.10.270

func (weightTrigger *WeightTrigger) OnAsciiGame(gameProp *GameProperty, pr *sgc7game.PlayResult, lst []*sgc7game.PlayResult, mapSymbolColor *asciigame.SymbolColorMap) error

OnAsciiGame - outpur to asciigame

func (*WeightTrigger) OnPlayGame added in v0.10.270

func (weightTrigger *WeightTrigger) OnPlayGame(gameProp *GameProperty, curpr *sgc7game.PlayResult, gp *GameParams, plugin sgc7plugin.IPlugin,
	cmd string, param string, ps sgc7game.IPlayerState, stake *sgc7game.Stake, prs []*sgc7game.PlayResult) error

playgame

func (*WeightTrigger) OnStats added in v0.10.270

func (weightTrigger *WeightTrigger) OnStats(feature *sgc7stats.Feature, stake *sgc7game.Stake, lst []*sgc7game.PlayResult) (bool, int64, int64)

OnStats

type WeightTriggerConfig added in v0.10.270

type WeightTriggerConfig struct {
	BasicComponentConfig `yaml:",inline"`
	NextComponents       []string `yaml:"nextComponents"`
	WeightSet            string   `yaml:"weightSet"`
}

WeightTriggerConfig - configuration for WeightTrigger

Jump to

Keyboard shortcuts

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