model

package
v0.0.0-...-a89b842 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package model is a generated protocol buffer package.

It is generated from these files:

model/solitaire.proto

It has these top-level messages:

Card
Pile
GameState
Move

Index

Constants

This section is empty.

Variables

View Source
var PileType_name = map[int32]string{
	0:  "NO_PILE",
	1:  "DECK",
	2:  "WASTE",
	10: "TABLEAU_0",
	11: "TABLEAU_1",
	12: "TABLEAU_2",
	13: "TABLEAU_3",
	14: "TABLEAU_4",
	15: "TABLEAU_5",
	16: "TABLEAU_6",
	20: "FOUNDATION_0",
	21: "FOUNDATION_1",
	22: "FOUNDATION_2",
	23: "FOUNDATION_3",
}
View Source
var PileType_value = map[string]int32{
	"NO_PILE":      0,
	"DECK":         1,
	"WASTE":        2,
	"TABLEAU_0":    10,
	"TABLEAU_1":    11,
	"TABLEAU_2":    12,
	"TABLEAU_3":    13,
	"TABLEAU_4":    14,
	"TABLEAU_5":    15,
	"TABLEAU_6":    16,
	"FOUNDATION_0": 20,
	"FOUNDATION_1": 21,
	"FOUNDATION_2": 22,
	"FOUNDATION_3": 23,
}
View Source
var PileType_values []PileType

Sorted by tag number

View Source
var Rank_name = map[int32]string{
	0:  "NO_RANK",
	1:  "ACE",
	2:  "TWO",
	3:  "THREE",
	4:  "FOUR",
	5:  "FIVE",
	6:  "SIX",
	7:  "SEVEN",
	8:  "EIGHT",
	9:  "NINE",
	10: "TEN",
	11: "JACK",
	12: "QUEEN",
	13: "KING",
}
View Source
var Rank_value = map[string]int32{
	"NO_RANK": 0,
	"ACE":     1,
	"TWO":     2,
	"THREE":   3,
	"FOUR":    4,
	"FIVE":    5,
	"SIX":     6,
	"SEVEN":   7,
	"EIGHT":   8,
	"NINE":    9,
	"TEN":     10,
	"JACK":    11,
	"QUEEN":   12,
	"KING":    13,
}
View Source
var Suit_name = map[int32]string{
	0: "NO_SUIT",
	1: "CLUBS",
	2: "DIAMONDS",
	3: "HEARTS",
	4: "SPADES",
}
View Source
var Suit_value = map[string]int32{
	"NO_SUIT":  0,
	"CLUBS":    1,
	"DIAMONDS": 2,
	"HEARTS":   3,
	"SPADES":   4,
}

Functions

This section is empty.

Types

type Card

type Card struct {
	Rank Rank `protobuf:"varint,1,opt,name=rank,enum=kitchensink.solitaire.model.Rank" json:"rank,omitempty"`
	Suit Suit `protobuf:"varint,2,opt,name=suit,enum=kitchensink.solitaire.model.Suit" json:"suit,omitempty"`
	// False means face down obviously
	FaceUp bool `protobuf:"varint,3,opt,name=face_up,json=faceUp" json:"face_up,omitempty"`
}

func (*Card) Descriptor

func (*Card) Descriptor() ([]byte, []int)

func (*Card) GetFaceUp

func (m *Card) GetFaceUp() bool

func (*Card) GetRank

func (m *Card) GetRank() Rank

func (*Card) GetSuit

func (m *Card) GetSuit() Suit

func (*Card) ProtoMessage

func (*Card) ProtoMessage()

func (*Card) Reset

func (m *Card) Reset()

func (*Card) String

func (m *Card) String() string

type GameState

type GameState struct {
	// Fixed for the duration of the game across all moves.
	GameId     *GameState_Id         `protobuf:"bytes,1,opt,name=game_id,json=gameId" json:"game_id,omitempty"`
	StateToken *GameState_StateToken `protobuf:"bytes,2,opt,name=state_token,json=stateToken" json:"state_token,omitempty"`
	// Only one pile of each type should be present. Piles SHOULD (but are not guaranteed) to be ordered by their
	// PileType tag.
	Piles []*Pile `protobuf:"bytes,10,rep,name=piles" json:"piles,omitempty"`
}

func (*GameState) Descriptor

func (*GameState) Descriptor() ([]byte, []int)

func (*GameState) GetGameId

func (m *GameState) GetGameId() *GameState_Id

func (*GameState) GetPile

func (gs *GameState) GetPile(pt PileType) *Pile

func (*GameState) GetPiles

func (m *GameState) GetPiles() []*Pile

func (*GameState) GetStateToken

func (m *GameState) GetStateToken() *GameState_StateToken

func (*GameState) ProtoMessage

func (*GameState) ProtoMessage()

func (*GameState) Reset

func (m *GameState) Reset()

func (*GameState) String

func (m *GameState) String() string

type GameState_Id

type GameState_Id struct {
	Seed int64 `protobuf:"fixed64,1,opt,name=seed" json:"seed,omitempty"`
	// Note that this nonce only technically needs to be unique within the context of the seed, but should
	// obviously by cryptographically securely generated
	Nonce int64 `protobuf:"fixed64,2,opt,name=nonce" json:"nonce,omitempty"`
}

Game IDs must be globally unique and used only once

func (*GameState_Id) Descriptor

func (*GameState_Id) Descriptor() ([]byte, []int)

func (*GameState_Id) GetNonce

func (m *GameState_Id) GetNonce() int64

func (*GameState_Id) GetSeed

func (m *GameState_Id) GetSeed() int64

func (*GameState_Id) ProtoMessage

func (*GameState_Id) ProtoMessage()

func (*GameState_Id) Reset

func (m *GameState_Id) Reset()

func (*GameState_Id) String

func (m *GameState_Id) String() string

type GameState_StateToken

type GameState_StateToken struct {
	MoveNum int32 `protobuf:"varint,1,opt,name=move_num,json=moveNum" json:"move_num,omitempty"`
}

func (*GameState_StateToken) Descriptor

func (*GameState_StateToken) Descriptor() ([]byte, []int)

func (*GameState_StateToken) GetMoveNum

func (m *GameState_StateToken) GetMoveNum() int32

func (*GameState_StateToken) ProtoMessage

func (*GameState_StateToken) ProtoMessage()

func (*GameState_StateToken) Reset

func (m *GameState_StateToken) Reset()

func (*GameState_StateToken) String

func (m *GameState_StateToken) String() string

type Move

type Move struct {
	SrcPile  PileType `protobuf:"varint,1,opt,name=src_pile,json=srcPile,enum=kitchensink.solitaire.model.PileType" json:"src_pile,omitempty"`
	DestPile PileType `protobuf:"varint,2,opt,name=dest_pile,json=destPile,enum=kitchensink.solitaire.model.PileType" json:"dest_pile,omitempty"`
	// Number of cards counted from the "top" (largest index) to the bottom (least index) in the src deck
	NumCards int32 `protobuf:"varint,3,opt,name=num_cards,json=numCards" json:"num_cards,omitempty"`
}

func (*Move) Descriptor

func (*Move) Descriptor() ([]byte, []int)

func (*Move) GetDestPile

func (m *Move) GetDestPile() PileType

func (*Move) GetNumCards

func (m *Move) GetNumCards() int32

func (*Move) GetSrcPile

func (m *Move) GetSrcPile() PileType

func (*Move) ProtoMessage

func (*Move) ProtoMessage()

func (*Move) Reset

func (m *Move) Reset()

func (*Move) String

func (m *Move) String() string

type Pile

type Pile struct {
	// NO_PILE is invalid
	PileType PileType `protobuf:"varint,1,opt,name=pile_type,json=pileType,enum=kitchensink.solitaire.model.PileType" json:"pile_type,omitempty"`
	// Cards are order from the bottom of the pile to the top of the pile.
	// The card at index 0 is at the bottom, and the card that is at index len()-1 is at the top (ie: typically playable).
	Cards []*Card `protobuf:"bytes,2,rep,name=cards" json:"cards,omitempty"`
}

func (*Pile) Descriptor

func (*Pile) Descriptor() ([]byte, []int)

func (*Pile) GetCards

func (m *Pile) GetCards() []*Card

func (*Pile) GetPileType

func (m *Pile) GetPileType() PileType

func (*Pile) ProtoMessage

func (*Pile) ProtoMessage()

func (*Pile) Reset

func (m *Pile) Reset()

func (*Pile) String

func (m *Pile) String() string

type PileType

type PileType int32
const (
	PileType_NO_PILE PileType = 0
	// The main deck
	// Cards are always face down in this pile
	PileType_DECK PileType = 1
	// Turn cards over from the deck to the waste pile to cycle through the deck.
	// If there are cards in this pile, at least the top card should be visible
	PileType_WASTE        PileType = 2
	PileType_TABLEAU_0    PileType = 10
	PileType_TABLEAU_1    PileType = 11
	PileType_TABLEAU_2    PileType = 12
	PileType_TABLEAU_3    PileType = 13
	PileType_TABLEAU_4    PileType = 14
	PileType_TABLEAU_5    PileType = 15
	PileType_TABLEAU_6    PileType = 16
	PileType_FOUNDATION_0 PileType = 20
	PileType_FOUNDATION_1 PileType = 21
	PileType_FOUNDATION_2 PileType = 22
	PileType_FOUNDATION_3 PileType = 23
)

func (PileType) EnumDescriptor

func (PileType) EnumDescriptor() ([]byte, []int)

func (PileType) IsFoundation

func (pt PileType) IsFoundation() bool

func (PileType) IsTableau

func (pt PileType) IsTableau() bool

func (PileType) String

func (x PileType) String() string

type Rank

type Rank int32
const (
	Rank_NO_RANK Rank = 0
	Rank_ACE     Rank = 1
	Rank_TWO     Rank = 2
	Rank_THREE   Rank = 3
	Rank_FOUR    Rank = 4
	Rank_FIVE    Rank = 5
	Rank_SIX     Rank = 6
	Rank_SEVEN   Rank = 7
	Rank_EIGHT   Rank = 8
	Rank_NINE    Rank = 9
	Rank_TEN     Rank = 10
	Rank_JACK    Rank = 11
	Rank_QUEEN   Rank = 12
	Rank_KING    Rank = 13
)

func (Rank) EnumDescriptor

func (Rank) EnumDescriptor() ([]byte, []int)

func (Rank) String

func (x Rank) String() string

type Suit

type Suit int32

Ordering here is based on the "bridge standard" which uses ascending alphabetical ordering. Not that it really matters... https://en.wikipedia.org/wiki/Suit_(cards)#Ranking_of_suits

const (
	Suit_NO_SUIT  Suit = 0
	Suit_CLUBS    Suit = 1
	Suit_DIAMONDS Suit = 2
	Suit_HEARTS   Suit = 3
	Suit_SPADES   Suit = 4
)

func (Suit) EnumDescriptor

func (Suit) EnumDescriptor() ([]byte, []int)

func (Suit) IsAlternateColor

func (s1 Suit) IsAlternateColor(s2 Suit) bool

func (Suit) IsBlack

func (s Suit) IsBlack() bool

func (Suit) IsRed

func (s Suit) IsRed() bool

func (Suit) String

func (x Suit) String() string

Jump to

Keyboard shortcuts

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