Documentation ¶
Overview ¶
Package card contains all the utilities to manipulate italian-style cards (set of 40 cards)
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item represents a card with number and seed
func FromID ¶
func FromID[T constraints.Integer](id T) (*Item, error)
FromID creates a new card Item (a card with number and seed) from an id ranging from 1 to 40 1-10 are Coin cards 11-20 are Cup cards 21-30 are Sword cards 31-40 are Cudgel cards
func MustID ¶
func MustID[T constraints.Integer](n T) *Item
MustID creates a new card Item (a card with number and seed) from an id ranging from 1 to 40, panics if outside
func New ¶
New creates a new card Item (a card with number and seed)
Example ¶
package main import ( "fmt" "github.com/mcaci/ita-cards/card" ) func main() { c, err := card.New("1", "Coin") if err != nil { fmt.Println(err) } fmt.Println(c) }
Output:
Click to show internal directories.
Click to hide internal directories.