data

package
v0.0.0-...-26702a2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Suit  `json:"suit"`
	Value `json:"value"`
}

func (Card) Beats

func (c Card) Beats(other Card) bool

func (Card) Worth

func (c Card) Worth() int

type ClientViolationEvent

type ClientViolationEvent struct {
	Message string `json:"message"`
}

func (ClientViolationEvent) IsOutboundEvent

func (ClientViolationEvent) IsOutboundEvent()

type CurrentPlayerEvent

type CurrentPlayerEvent struct {
	PlayerID uuid.UUID `json:"playerID"`
}

func (CurrentPlayerEvent) IsOutboundEvent

func (CurrentPlayerEvent) IsOutboundEvent()

type CurrentPlayersEvent

type CurrentPlayersEvent struct {
	PlayerIDs []uuid.UUID `json:"players"`
	GameReady bool        `json:"gameReady"`
}

func (CurrentPlayersEvent) IsOutboundEvent

func (CurrentPlayersEvent) IsOutboundEvent()

type InPlayEvent

type InPlayEvent struct {
	InPlay []PlayerCard `json:"inPlay"`
}

func (InPlayEvent) IsOutboundEvent

func (InPlayEvent) IsOutboundEvent()

type InboundEvent

type InboundEvent interface {
	IsInboundEvent()
}

type InboundEventType

type InboundEventType string
const (
	InboundPlayCard InboundEventType = "playCard"
)

type InboundPayload

type InboundPayload struct {
	Type InboundEventType `json:"type"`
	Data InboundEvent     `json:"data"`
}

func (*InboundPayload) UnmarshalJSON

func (i *InboundPayload) UnmarshalJSON(bytes []byte) (err error)

type NewHandEvent

type NewHandEvent struct {
	Hand []Card `json:"hand"`
}

func (NewHandEvent) IsOutboundEvent

func (NewHandEvent) IsOutboundEvent()

type OutboundEvent

type OutboundEvent interface {
	IsOutboundEvent()
}

type OutboundEventType

type OutboundEventType string
const (
	OutboundClientViolation OutboundEventType = "clientViolation"
	OutboundNewHand         OutboundEventType = "newHand"
	OutboundCurrentPlayer   OutboundEventType = "currentPlayer"
	OutboundInPlay          OutboundEventType = "inPlay"
	OutboundCurrentPlayers  OutboundEventType = "currentPlayers"
	OutboundPoints          OutboundEventType = "points"
)

type OutboundPayload

type OutboundPayload struct {
	Type OutboundEventType `json:"type"`
	Data OutboundEvent     `json:"data"`
}

func (*OutboundPayload) UnmarshalJSON

func (o *OutboundPayload) UnmarshalJSON(bytes []byte) (err error)

type PlayCardEvent

type PlayCardEvent struct {
	Card Card `json:"card"`
}

func (PlayCardEvent) IsInboundEvent

func (PlayCardEvent) IsInboundEvent()

type PlayerCard

type PlayerCard struct {
	PlayerID uuid.UUID `json:"player"`
	Card     `json:"card"`
}

type PointsEvent

type PointsEvent struct {
	Points map[uuid.UUID]int `json:"points"`
}

func (PointsEvent) IsOutboundEvent

func (PointsEvent) IsOutboundEvent()

type Suit

type Suit uint8
const (
	SuitHearts Suit = iota
	SuitDiamonds
	SuitClubs
	SuitSpades
)

type Value

type Value uint8
const (
	ValueTwo Value = iota
	ValueThree
	ValueFour
	ValueFive
	ValueSix
	ValueSeven
	ValueEight
	ValueNine
	ValueTen
	ValueJack
	ValueQueen
	ValueKing
	ValueAce
)

Jump to

Keyboard shortcuts

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