core

package
v0.0.0-...-4d1603a Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltMode

type BuiltMode interface {
	lsha.ModeRegistration
	GetName() string
	GetDescription() string
	GetPlayerCountLimit() (min, max int)
	ValidateUser(user lsha.User) (reason string)
	CreateConfigBuilder() (configData any, creator func(readonly bool) []*form.Item)
	Run(configData any, users []lsha.User)
}

func BuildMode

func BuildMode(r func(lsha.ModeBuilder)) BuiltMode

type BuiltPlugin

type BuiltPlugin interface {
	GetName() string
	GetDescription() string
	GetVersion() int
	GetDependents() map[string]int
	Load(registration lsha.ModeRepository)
}

func BuildPlugin

func BuildPlugin(r lsha.PluginRegister) BuiltPlugin

type Context

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

func (Context) AddTrigger

func (c Context) AddTrigger(trigger lsha.Trigger, player lsha.Player, eventNames ...string) (id uint64)

func (Context) BindData

func (c Context) BindData(data any)

func (Context) Data

func (c Context) Data() any

func (*Context) Event

func (c *Context) Event() lsha.Event

func (*Context) Invoke

func (c *Context) Invoke(event lsha.Event)

func (Context) NextPlayer

func (c Context) NextPlayer(player lsha.Player) lsha.Player

func (Context) PlayerIter

func (c Context) PlayerIter(start lsha.Player) iter.Seq[lsha.Player]

func (Context) RemoveTrigger

func (c Context) RemoveTrigger(id uint64)

func (Context) RoomConfig

func (c Context) RoomConfig() any

func (Context) RuntimeConfig

func (c Context) RuntimeConfig() lsha.ConfigBuilder

func (Context) Turn

func (c Context) Turn() lsha.Turn

func (*Context) WithEvent

func (c *Context) WithEvent(event lsha.Event) lsha.Context

type ModeInitUserBuilder

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

func (*ModeInitUserBuilder) BindData

func (m *ModeInitUserBuilder) BindData(data any) lsha.ModeInitUserBuilder

func (*ModeInitUserBuilder) Order

func (m *ModeInitUserBuilder) Order() int

func (*ModeInitUserBuilder) RewriteOrder

func (m *ModeInitUserBuilder) RewriteOrder(order int) lsha.ModeInitUserBuilder

func (*ModeInitUserBuilder) User

func (m *ModeInitUserBuilder) User() lsha.User

type Phase

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

func (*Phase) BindData

func (p *Phase) BindData(data any)

func (*Phase) Data

func (p *Phase) Data() any

func (*Phase) Name

func (p *Phase) Name() string

type PhaseBuilder

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

func (*PhaseBuilder) Name

func (p *PhaseBuilder) Name(name string) lsha.PhaseBuilder

type Player

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

func (*Player) BindData

func (p *Player) BindData(data any)

func (*Player) Data

func (p *Player) Data() any

func (*Player) Effects

func (p *Player) Effects() lsha.Effect

func (*Player) IsAlive

func (p *Player) IsAlive() bool

func (*Player) Order

func (p *Player) Order() int

func (*Player) User

func (p *Player) User() lsha.User

type Trigger

type Trigger struct {
	lsha.Trigger
	// contains filtered or unexported fields
}

type Turn

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

func (*Turn) BindData

func (t *Turn) BindData(data any)

func (*Turn) Data

func (t *Turn) Data() any

func (*Turn) Phase

func (t *Turn) Phase() lsha.Phase

func (*Turn) Player

func (t *Turn) Player() lsha.Player

func (*Turn) Round

func (t *Turn) Round() int

type TurnBuilder

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

func (*TurnBuilder) OnNextPhase

func (t *TurnBuilder) OnNextPhase(phaseStarter lsha.PhaseStarter) lsha.TurnBuilder

func (*TurnBuilder) Player

func (t *TurnBuilder) Player(p lsha.Player) lsha.TurnBuilder

func (*TurnBuilder) Round

func (t *TurnBuilder) Round(n int) lsha.TurnBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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