round

package
v0.0.0-...-d26b62e Latest Latest
Warning

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

Go to latest
Published: Sep 12, 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 ActionRoundOptions

type ActionRoundOptions struct {
	Success          bool
	Payload          *money.Money
	SuccessfulAction *events.Action
	PlayerId         string
	PreFlop          bool
	CanCheck         bool
	CheckCount       byte
	Current          int
	BlockingIndex    int
	BlockingList     *BlockingList
}

type BlockingList

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

func NewBlockingList

func NewBlockingList(list []int) *BlockingList

func (*BlockingList) AddAllButThisBlocking

func (l *BlockingList) AddAllButThisBlocking(players []models.Player, k int, bank bank.Interface) []int

func (*BlockingList) AddBlocking

func (l *BlockingList) AddBlocking(k int) error

func (*BlockingList) CheckIfEmpty

func (l *BlockingList) CheckIfEmpty() bool

func (*BlockingList) ContainsIndex

func (l *BlockingList) ContainsIndex(i int) bool

func (*BlockingList) Get

func (l *BlockingList) Get(i int) int

func (*BlockingList) GetNext

func (l *BlockingList) GetNext(removed bool, i int) int

func (*BlockingList) Length

func (l *BlockingList) Length() int

func (*BlockingList) RemoveBlocking

func (l *BlockingList) RemoveBlocking(i int)

type Interface

type Interface interface {
	Leave(id string) error
	Start(players []models.Player, publicPlayers []models.PublicPlayer, dealer int)
}

type Round

type Round struct {
	//Players includes all the Players who have started this hand. After a fold the player is still included
	Players       []models.Player
	PublicPlayers []models.PublicPlayer
	Bank          bank.Interface
	Board         [5]models.Card
	HoleCards     map[string][2]models.Card
	SmallBlind    *money.Money
	Dealer        int

	InCount byte
	Ended   bool
	// contains filtered or unexported fields
}

Round is one game of a session. it results in everybody but one folding or a showdown Probably this could be optimised into multiple structs.

func NewRound

func NewRound(b bank.Interface, smallBlind int) *Round

NewRound creates a new hand and sets the dealer to the next

func (*Round) Leave

func (r *Round) Leave(id string) error

func (*Round) Start

func (r *Round) Start(players []models.Player, publicPlayers []models.PublicPlayer, dealer int)

Jump to

Keyboard shortcuts

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