sgc7game

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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
)

Variables

View Source
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")
)

Functions

func DropDownSymbols(scene *GameScene) error

DropDownSymbols - drop down symbols

func GetPlayResultCurIndex

func GetPlayResultCurIndex(prs []*PlayResult) int

GetPlayResultCurIndex - get current index

func LoadGameConfig

func LoadGameConfig(fn string, cfg interface{}) error

LoadGameConfig - load configuration

func PlayResult2JSON

func PlayResult2JSON(pr *PlayResult) ([]byte, error)

PlayResult2JSON - PlayResult => json

func RandWithWeights

func RandWithWeights(plugin sgc7plugin.IPlugin, max int, arr []int) (int, error)

RandWithWeights - random with the weights

func RemoveSymbolWithResult

func RemoveSymbolWithResult(scene *GameScene, result *PlayResult) error

RemoveSymbolWithResult - remove symbol with win result

Types

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

func (game *BasicGame) AddGameMod(gmod IGameMod) error

AddGameMod - add a gamemod

func (*BasicGame) CheckStake

func (game *BasicGame) CheckStake(stake *Stake) error

CheckStake - check stake

func (*BasicGame) FreePlugin

func (game *BasicGame) FreePlugin(plugin sgc7plugin.IPlugin)

FreePlugin - free a plugin

func (*BasicGame) GetConfig

func (game *BasicGame) GetConfig() *Config

GetConfig - get config

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

func (*BasicGame) SetVer

func (game *BasicGame) SetVer(ver string)

SetVer - set server version

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

type BasicGameMod struct {
	Name   string
	Width  int
	Height int
}

BasicGameMod - basic gameMod

func NewBasicGameMod

func NewBasicGameMod(name string, w int, h int) *BasicGameMod

NewBasicGameMod - new a BasicGameMod

func (*BasicGameMod) GetName

func (mod *BasicGameMod) GetName() string

GetName - get mode name

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"`
}

Config - config

func NewConfig

func NewConfig() *Config

NewConfig - new a Config

func (*Config) AddDefaultSceneString2

func (cfg *Config) AddDefaultSceneString2(str string) error

AddDefaultSceneString2 - [][]int in json

func (*Config) LoadLine

func (cfg *Config) LoadLine(fn string, reels int) error

LoadLine - load linedata for reels

func (*Config) LoadLine3

func (cfg *Config) LoadLine3(fn string) error

LoadLine3 - load linedata for reels 3

func (*Config) LoadLine5

func (cfg *Config) LoadLine5(fn string) error

LoadLine5 - load linedata for reels 5

func (*Config) LoadLine6

func (cfg *Config) LoadLine6(fn string) error

LoadLine6 - load linedata for reels 6

func (*Config) LoadPayTables

func (cfg *Config) LoadPayTables(fn string, reels int) error

LoadPayTables - load paytables for reels

func (*Config) LoadPayTables3

func (cfg *Config) LoadPayTables3(fn string) error

LoadPayTables3 - load paytables for reels 3

func (*Config) LoadPayTables5

func (cfg *Config) LoadPayTables5(fn string) error

LoadPayTables5 - load paytables for reels 5

func (*Config) LoadPayTables6

func (cfg *Config) LoadPayTables6(fn string) error

LoadPayTables6 - load paytables for reels 6

func (*Config) LoadReels

func (cfg *Config) LoadReels(name string, fn string, reels int) error

LoadReels - load reels for reels

func (*Config) LoadReels3

func (cfg *Config) LoadReels3(name string, fn string) error

LoadReels3 - load reels 3

func (*Config) LoadReels5

func (cfg *Config) LoadReels5(name string, fn string) error

LoadReels5 - load reels 5

func (*Config) LoadSymboloWeightReels

func (cfg *Config) LoadSymboloWeightReels(name string, fn string, reels int) error

LoadSymboloWeightReels - load reels for SymbolWeightReels

func (*Config) SetDefaultSceneString

func (cfg *Config) SetDefaultSceneString(str string) error

SetDefaultSceneString - [][]int in json

type FastReelsRandomSP

type FastReelsRandomSP struct {
	Reels    *ReelsData
	ArrIndex [][]int
}

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 FuncCalcOtherMul

type FuncCalcOtherMul func(scene *GameScene, result *Result) int

FuncCalcOtherMul - calc other multi

type FuncCalcOtherMulEx

type FuncCalcOtherMulEx func(scene *GameScene, symbol int, pos []int) int

FuncCalcOtherMulEx - calc other multi

type FuncCountSymbolExIsSymbol

type FuncCountSymbolExIsSymbol func(cursymbol int, x, y int) bool

FuncCountSymbolExIsSymbol -

type FuncCountSymbolInReel

type FuncCountSymbolInReel func(cursymbol int, scene *GameScene, x int) int

FuncCountSymbolInReel - count symbol nums in a reel

type FuncForEach

type FuncForEach func(x, y int, val int)

FuncForEach - function for ForEach

type FuncGetSymbol

type FuncGetSymbol func(cursymbol int) int

FuncGetSymbol - get symbol

type FuncIsSameSymbol

type FuncIsSameSymbol func(cursymbol int, startsymbol int) bool

FuncIsSameSymbol - cursymbol == startsymbol

type FuncIsSameSymbolEx

type FuncIsSameSymbolEx func(cursymbol int, startsymbol int, scene *GameScene, x, y int) bool

FuncIsSameSymbolEx - cursymbol == startsymbol

type FuncIsScatter

type FuncIsScatter func(scatter int, cursymbol int) bool

FuncIsScatter - cursymbol == scatter

type FuncIsSymbol

type FuncIsSymbol func(cursymbol int) bool

FuncIsSymbol - is symbol

type FuncIsValidSymbol

type FuncIsValidSymbol func(cursymbol int) bool

FuncIsValidSymbol - is it a valid symbol?

type FuncIsValidSymbolEx

type FuncIsValidSymbolEx func(cursymbol int, scene *GameScene, x, y int) bool

FuncIsValidSymbolEx - is it a valid symbol?

type FuncIsWild

type FuncIsWild func(cursymbol int) bool

FuncIsWild - cursymbol == wild

type FuncNewBasicPlayerState

type FuncNewBasicPlayerState func() *BasicPlayerState

FuncNewBasicPlayerState - new BasicPlayerState and set PlayerBoostData

type FuncOnSelectReelIndex

type FuncOnSelectReelIndex func(reels *ReelsData, x int, y int) []int

FuncOnSelectReelIndex - onSelectReelIndex

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

func NewGameScene(width int, height int) (*GameScene, error)

NewGameScene - new a GameScene

func NewGameSceneEx

func NewGameSceneEx(heights []int) (*GameScene, error)

NewGameSceneEx - new a GameScene

func NewGameSceneWithArr

func NewGameSceneWithArr(w, h int, arr []int) (*GameScene, error)

NewGameSceneWithArr - new a GameScene

func NewGameSceneWithArr2

func NewGameSceneWithArr2(arr [][]int) (*GameScene, error)

NewGameSceneWithArr2 - new a GameScene

func NewGameSceneWithArr2Ex

func NewGameSceneWithArr2Ex(arr [][]int) (*GameScene, error)

NewGameSceneWithArr2Ex - new a GameScene

func NewGameSceneWithReels

func NewGameSceneWithReels(reels *ReelsData, w, h int, arr []int) (*GameScene, error)

NewGameSceneWithReels - new a GameScene

func (*GameScene) Clone

func (gs *GameScene) Clone() *GameScene

Clone - clone

func (*GameScene) CountSymbol

func (gs *GameScene) CountSymbol(s int) int

CountSymbol - count a symbol

func (*GameScene) CountSymbolEx

func (gs *GameScene) CountSymbolEx(issymbol FuncCountSymbolExIsSymbol) int

CountSymbolEx - count a symbol

func (*GameScene) CountSymbols

func (gs *GameScene) CountSymbols(arr []int) []int

CountSymbols - count some symbols

func (*GameScene) Fill

func (gs *GameScene) Fill(reels *ReelsData, arr []int)

Fill - fill with reels and indexs

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) HasSymbol

func (gs *GameScene) HasSymbol(s int) bool

HasSymbol - has a symbol

func (*GameScene) Init

func (gs *GameScene) Init(w int, h int) error

Init - init scene

func (*GameScene) InitEx

func (gs *GameScene) InitEx(h []int) error

InitEx - init scene

func (*GameScene) InitWithArr

func (gs *GameScene) InitWithArr(w int, h int, arr []int) error

InitWithArr - init scene

func (*GameScene) InitWithArr2

func (gs *GameScene) InitWithArr2(arr [][]int) error

InitWithArr2 - init scene

func (*GameScene) InitWithArr2Ex

func (gs *GameScene) InitWithArr2Ex(arr [][]int) error

InitWithArr2Ex - init scene

func (*GameScene) RandReels

func (gs *GameScene) RandReels(game IGame, plugin sgc7plugin.IPlugin, reelsName string) error

RandReels - random with reels

func (*GameScene) ResetReelIndex

func (gs *GameScene) ResetReelIndex(game IGame, reelsName string, x int, index int) error

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
}

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 LineData

type LineData struct {
	Lines [][]int `json:"lines"`
}

LineData - line data

func LoadLine3JSON

func LoadLine3JSON(fn string) (*LineData, error)

LoadLine3JSON - load json file

func LoadLine5JSON

func LoadLine5JSON(fn string) (*LineData, error)

LoadLine5JSON - load json file

func LoadLine6JSON

func LoadLine6JSON(fn string) (*LineData, error)

LoadLine6JSON - load json file

type PayTables

type PayTables struct {
	MapPay map[int][]int `json:"paytables"`
}

PayTables - pay tables

func LoadPayTables3JSON

func LoadPayTables3JSON(fn string) (*PayTables, error)

LoadPayTables3JSON - load json file

func LoadPayTables5JSON

func LoadPayTables5JSON(fn string) (*PayTables, error)

LoadPayTables5JSON - load json file

func LoadPayTables6JSON

func LoadPayTables6JSON(fn string) (*PayTables, error)

LoadPayTables6JSON - load json file

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

func LoadReels3JSON(fn string) (*ReelsData, error)

LoadReels3JSON - load json file

func LoadReels5JSON

func LoadReels5JSON(fn string) (*ReelsData, error)

LoadReels5JSON - load json file

func (*ReelsData) DropDownIntoGameScene

func (rd *ReelsData) DropDownIntoGameScene(scene *GameScene, indexes []int) ([]int, error)

DropDownIntoGameScene - 用轮子当前位置处理下落

注意:
	1. 这个接口需要特别注意,传入indexes是上一次用过的,所以实际用应该-1
	2. 这个接口按道理只会对index做减法操作,所以不会考虑向下越界问题,只处理向上的越界

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 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 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 CalcScatterEx

func CalcScatterEx(scene *GameScene, scatter int, nums int, isScatter FuncIsScatter) *Result

CalcScatterEx - calc scatter

type ResultType

type ResultType int

ResultType - result type

type Stake

type Stake struct {
	CoinBet  int64
	CashBet  int64
	Currency string
}

Stake - stake

type SymbolWeightReelData

type SymbolWeightReelData struct {
	Symbols    []int
	Weights    []int
	MaxWeights int
}

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

Jump to

Keyboard shortcuts

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