Documentation ¶
Index ¶
Constants ¶
View Source
const ( Clubs = 0 Diamonds = 1 Hearts = 2 Spades = 3 )
Colors of the card
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct { Color int `json:"color" mapstructure:"color"` Value int `json:"value" mapstructure:"value"` }
Card represents a play card which has a color and a value Values: [0,2];[1,3];[2,4];[3,5];[4,6];[5,7];[6,8];[7,9];[8,10];[9,J];[10,Q];[11,K];[12,A]
type Event ¶
type Event struct { Name string `json:"event"` Data interface{} `json:"data"` }
func NewEventFromRaw ¶
type Player ¶
type Player struct { //ID the id of the player. should be unique ID string `json:"id" mapstructure:"buyin"` //Username the username Username string `json:"username" mapstructure:"buyin"` //BuyIn buy in BuyIn *money.Money `json:"buyin" mapstructure:"buyin"` //Out channel to the outside. Will be send over websocket. Out chan []byte //In channel is the incoming channel over the websocket conn. In chan *Event //Active active Active bool //Close channel will be closed when player leaves Close chan bool //Left determins if the player already quitted but is in an active round Left bool }
func (*Player) ToPublic ¶
func (p *Player) ToPublic() *PublicPlayer
func (*Player) ToPublicWithWallet ¶
func (p *Player) ToPublicWithWallet(b Bank) *PublicPlayer
type PublicPlayer ¶
type PublicPlayer struct { Username string `json:"username" mapstructure:"username"` ID string `json:"id" mapstructure:"id"` BuyIn string `json:"buyIn" mapstructure:"buyIn"` BuyInNum float64 `json:"buyInNum" mapstructure:"buyInNum"` }
func (*PublicPlayer) SetBuyIn ¶
func (p *PublicPlayer) SetBuyIn(buyIn string, buyInNum float64)
func (*PublicPlayer) String ¶
func (p *PublicPlayer) String() string
Click to show internal directories.
Click to hide internal directories.