game

package
v0.0.0-...-bd21981 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	Context    context.Context
	Dealer     bool
	Human      *Player
	Robot      *Player
	Wall       tile.Instances
	Client     client.Controller
	Connection network.XMLConnection

	Turn    bool
	Rinshan bool
	// contains filtered or unexported fields
}

func NewGame

func NewGame(c network.XMLConnection) *Game

func (*Game) GetHand

func (g *Game) GetHand() compact.Instances

func (*Game) HumanTurn

func (g *Game) HumanTurn() (result bool)

func (*Game) MakeDraw

func (g *Game) MakeDraw()

func (*Game) MakeTurn

func (g *Game) MakeTurn() (x bool)

func (*Game) Player

func (g *Game) Player(x bool) *Player

func (*Game) ProcessOne

func (g *Game) ProcessOne(cb *server.Callbacks) bool

func (*Game) RobotTurn

func (g *Game) RobotTurn() (result bool)

func (*Game) Run

func (g *Game) Run()

func (*Game) RunOne

func (g *Game) RunOne(rnd int, startTile tile.Tile) bool

type Player

type Player struct {
	Hand    compact.Instances
	Melds   tbase.CalledList
	Discard compact.Instances
	Score   score.Money
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(x score.Money) *Player

func (*Player) Init

func (p *Player) Init(hand compact.Instances)

func (*Player) Waits

func (p *Player) Waits() compact.Tiles

Jump to

Keyboard shortcuts

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