Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct {
// contains filtered or unexported fields
}
Card represents a card in a deck.
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
Code represents a card code.
func NewCode ¶
NewCode returns a new card code given a string. The string must be 2 characters long. The first character must be a valid rank. The second character must be a valid suit.
func NewCodeFromRankSuit ¶
NewCodeFromRankSuit returns a new code given a rank and suit.
func (Code) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Code) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Composition ¶
type Composition struct {
// contains filtered or unexported fields
}
Composition represents a collection of ranks and suits. (e.g french)
func NewComposition ¶
func NewComposition(r Ranks, s Suits) Composition
NewComposition returns a new card composition given a collection of ranks and suits.
type Rank ¶
type Rank struct {
// contains filtered or unexported fields
}
Rank represents the rank of a card.
type Ranks ¶
type Ranks []Rank
Ranks is a collection of Rank.
func (Ranks) RankFromCode ¶
RankFromCode returns the rank from the given code.