example

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PlayRoomLimiter smachine.SyncLink = smsync.NewConditionalBool(true, "unlimited rooms").SyncLink()

Functions

func RunExample

func RunExample(machineLogger smachine.SlotMachineLogger)

Types

type GameChooseAdapter

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

func NewGameAdapter

func NewGameAdapter(ctx context.Context, svc GameChooseService) *GameChooseAdapter

type GameChooseService

type GameChooseService interface {
	ChooseGame() GameFactoryFunc
}

func NewGameChooseService

func NewGameChooseService() GameChooseService

type GameFactoryFunc

type GameFactoryFunc func(GamePlayers) GameStateMachine

type GamePlayers

type GamePlayers struct {
	Players     []smachine.BargeIn
	PlayerIndex int
}

type GameRandom

type GameRandom struct {
	GameTemplate
	// contains filtered or unexported fields
}

func (*GameRandom) GetGameResult

func (g *GameRandom) GetGameResult() GameResult

func (*GameRandom) GetSubroutineInitState

func (g *GameRandom) GetSubroutineInitState(ctx smachine.SubroutineStartContext) smachine.InitFunc

type GameResult

type GameResult struct {
}

type GameStateMachine

type GameStateMachine interface {
	smachine.SubroutineStateMachine
	GetGameResult() GameResult
}

func NewGameOfRandom

func NewGameOfRandom(gameKey longbits.ByteString, players GamePlayers) GameStateMachine

type GameTemplate

type GameTemplate struct {
	smachine.StateMachineDeclTemplate
	// contains filtered or unexported fields
}

func (*GameTemplate) GetInitStateFor

func (g *GameTemplate) GetInitStateFor(smachine.StateMachine) smachine.InitFunc

func (*GameTemplate) GetStateMachineDeclaration

func (g *GameTemplate) GetStateMachineDeclaration() smachine.StateMachineDeclaration

type PlayerSM

type PlayerSM struct {
	smachine.StateMachineDeclTemplate
	// contains filtered or unexported fields
}

func (PlayerSM) GetInitStateFor

func (PlayerSM) GetInitStateFor(sm smachine.StateMachine) smachine.InitFunc

GetInitStateFor is a method of SM declaration that provides an init step for the given SM This method is invoked after injections and can rely on fields of SM. Nil returned by GetInitStateFor will cause an error for a caller.

func (*PlayerSM) GetStateMachineDeclaration

func (p *PlayerSM) GetStateMachineDeclaration() smachine.StateMachineDeclaration

GetStateMachineDeclaration returns a declaration (class) of a state machine. Declaration is responsible for various initialization and processing capabilities.

For simplicity - SM declaration could be the same object as SM. When implementing SM declaration please embed smachine.StateMachineDeclTemplate to avoid manual implementation of required methods.

func (PlayerSM) InjectDependencies

func (PlayerSM) InjectDependencies(sm smachine.StateMachine, link smachine.SlotLink, dj injector.DependencyInjector)

type SharedPairData

type SharedPairData struct {
	// contains filtered or unexported fields
}
type SharedPairDataLink struct {
	// contains filtered or unexported fields
}

func (SharedPairDataLink) PrepareAccess

func (v SharedPairDataLink) PrepareAccess(fn func(*SharedPairData) (wakeup bool)) smachine.SharedDataAccessor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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