core

package
v0.0.0-...-3b8a073 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardDef

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

type CommonConfig

type CommonConfig struct {
	ShuffleUsers bool
}

type Context

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

func NewContext

func NewContext() *Context

func (*Context) SelectHeroes

func (c *Context) SelectHeroes(req *sgs.SelectHeroesReq) *sgs.SelectHeroesResp

func (*Context) StartHero

func (c *Context) StartHero(p sgs.Player, h *sgs.Hero)

func (*Context) StartTurn

func (c *Context) StartTurn(p sgs.Player)

func (*Context) WithEvent

func (c *Context) WithEvent() sgs.Context

type EffectDef

type EffectDef struct {
}

type Loader

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

func NewLoader

func NewLoader() *Loader

func (*Loader) AddCard

func (l *Loader) AddCard(card *sgs.Card)

func (*Loader) AddCardType

func (l *Loader) AddCardType(cardType *sgs.CardType) *sgs.CardType

func (*Loader) AddHero

func (l *Loader) AddHero(hero *sgs.Hero)

func (*Loader) FilterCards

func (l *Loader) FilterCards(modeType sgs.ModeType) []*sgs.Card

func (*Loader) FilterHeroes

func (l *Loader) FilterHeroes(modeType sgs.ModeType) []*sgs.Hero

func (*Loader) FinishLoading

func (l *Loader) FinishLoading()

func (*Loader) GetCards

func (l *Loader) GetCards(cardTypeName string) []*sgs.Card

func (*Loader) GetHero

func (l *Loader) GetHero(name sgs.HeroName) []*sgs.Hero

func (*Loader) GetHeroWithSuffix

func (l *Loader) GetHeroWithSuffix(name sgs.HeroName, suffix string) *sgs.Hero

func (*Loader) StartSolo

func (l *Loader) StartSolo(c *SoloConfig, users []*User) *Result

type ModeRegistration

type ModeRegistration struct {
	Heroes      []*sgs.Hero
	NameToCards map[string]*sgs.Card
	Cards       []*sgs.Card
	Effects     map[string]*sgs.Effect
}

type Ordered

type Ordered[T any] struct {
	V     *T
	Index int
}

type Result

type Result struct {
}

type SoloConfig

type SoloConfig struct {
	*CommonConfig
	Mock *SoloMockConfig
}

func NewSoloConfig

func NewSoloConfig() *SoloConfig

type SoloHandler

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

func NewSoloHandler

func NewSoloHandler(l *Loader, c *SoloConfig, users []*User) *SoloHandler

func (*SoloHandler) Start

func (h *SoloHandler) Start()

type SoloHeroPickRule

type SoloHeroPickRule interface {
	Prepare(players []*SoloPlayer, allHeroes []*sgs.Hero) (remainedHeroes []*sgs.Hero)
	NextPick() *SoloPickHeroesOption
	UseCount(player *SoloPlayer) int
}

type SoloMockConfig

type SoloMockConfig struct {
	MockHeroNames [][]string
}

type SoloPickHeroesOption

type SoloPickHeroesOption struct {
	Candidates []*sgs.HeroToSelect
	TargetN    int         // if zero, no need to select
	Player     *SoloPlayer // if nil, no need to select
	Callback   func(heroes []*sgs.Hero) (willContinue bool)
}

type SoloPlayer

type SoloPlayer struct {
	*User
	SelectedHeroes []*sgs.Hero
	PlayedHeroes   []*sgs.Hero
	PlayingHero    *sgs.Hero
}

type SoloResult

type SoloResult struct {
}

type User

type User struct {
}

Jump to

Keyboard shortcuts

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