cards

package
v0.0.0-...-a7858fa Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUITE_EMPTY    Suite = -1
	SUITE_CLUBS    Suite = 0
	SUITE_DIAMONDS Suite = 1
	SUITE_HEARTS   Suite = 2
	SUITE_SPADES   Suite = 3

	VALUE_EMPTY Value = -1
)

Variables

This section is empty.

Functions

func CanPlaceOnFoundation

func CanPlaceOnFoundation(card *Card, foundation *Card) bool

func CanStack

func CanStack(stackType StackType, from *Card, to *Card) bool

Types

type Card

type Card struct {
	Value     Value
	Suite     Suite
	IsVisible bool
}

func NewCard

func NewCard(value Value, suite Suite) *Card

func NewEmptyCard

func NewEmptyCard() *Card

func (*Card) Equals

func (c *Card) Equals(other *Card) bool

func (*Card) IsBlack

func (c *Card) IsBlack() bool

func (*Card) IsEmpty

func (c *Card) IsEmpty() bool

func (*Card) IsFoundation

func (c *Card) IsFoundation() bool

func (*Card) IsRed

func (c *Card) IsRed() bool

func (*Card) Label

func (c *Card) Label() string

func (*Card) String

func (p *Card) String() string

func (*Card) SuiteString

func (c *Card) SuiteString() string

func (*Card) ValueString

func (c *Card) ValueString() string

func (*Card) View

func (c *Card) View(selected bool, hovered bool, stacked bool) string

type Deck

type Deck []*Card

func CreateDeck

func CreateDeck() Deck

func Shuffle

func Shuffle(d *Deck, s int) Deck

type Move

type Move struct {
	From Pos
	To   Pos
}

func (*Move) String

func (m *Move) String() string

type MoveHistory

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

func (*MoveHistory) Pop

func (h *MoveHistory) Pop() *Move

func (*MoveHistory) Push

func (h *MoveHistory) Push(m *Move)

func (*MoveHistory) Size

func (h *MoveHistory) Size() int

func (*MoveHistory) String

func (h *MoveHistory) String() string

type Pallet

type Pallet struct {
	Parts  parts
	Styles styles
}

type Pos

type Pos struct {
	X int
	Y int
}

func (*Pos) Add

func (p *Pos) Add(x, y int) *Pos

func (*Pos) Equals

func (p *Pos) Equals(other *Pos) bool

func (*Pos) String

func (p *Pos) String() string

type StackType

type StackType uint8
const (
	SAME_COLOR_ASC  StackType = 0
	SAME_COLOR_DESC StackType = 1
	ALT_COLOR_ASC   StackType = 2
	ALT_COLOR_DESC  StackType = 3
	SAME_SUITE_ASC  StackType = 4
	SAME_SUITE_DESC StackType = 5
)

type Suite

type Suite int8

type Value

type Value int8

Jump to

Keyboard shortcuts

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