player

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT, MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cards

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

Cards matains the card a Player have in hands

func (*Cards) Add

func (p *Cards) Add(card card.Card) error

Add a card to cards

func (*Cards) Drop

func (p *Cards) Drop(card card.Card) error

Drop a card from Player's hand

func (Cards) Get

func (p Cards) Get(index int) card.Card

Get returns the index-th card

func (Cards) Have

func (p Cards) Have(card card.Card) bool

Have that card?

func (Cards) Len

func (p Cards) Len() int

Len returns the len of cards

type Player

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

Player contains the player data.

func New

func New(id, name string) Player

New returns a new Player

func (Player) ID

func (p Player) ID() string

ID returns the current id

func (Player) Is

func (p Player) Is(who Player) bool

Is returns true if who is p

func (Player) IsEmpty

func (p Player) IsEmpty() bool

IsEmpty returns true if .id is an empty string

Jump to

Keyboard shortcuts

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