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 ¶
- Variables
- type Card
- type GameState
- func (*GameState) Descriptor() ([]byte, []int)
- func (m *GameState) GetGameId() *GameState_Id
- func (gs *GameState) GetPile(pt PileType) *Pile
- func (m *GameState) GetPiles() []*Pile
- func (m *GameState) GetStateToken() *GameState_StateToken
- func (*GameState) ProtoMessage()
- func (m *GameState) Reset()
- func (m *GameState) String() string
- type GameState_Id
- type GameState_StateToken
- type Move
- type Pile
- type PileType
- type Rank
- type Suit
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) ProtoMessage ¶
func (*Card) ProtoMessage()
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) GetGameId ¶
func (m *GameState) GetGameId() *GameState_Id
func (*GameState) GetStateToken ¶
func (m *GameState) GetStateToken() *GameState_StateToken
func (*GameState) ProtoMessage ¶
func (*GameState) ProtoMessage()
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) GetDestPile ¶
func (*Move) GetNumCards ¶
func (*Move) GetSrcPile ¶
func (*Move) ProtoMessage ¶
func (*Move) ProtoMessage()
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) GetPileType ¶
func (*Pile) ProtoMessage ¶
func (*Pile) ProtoMessage()
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) IsFoundation ¶
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
func (Suit) EnumDescriptor ¶
func (Suit) IsAlternateColor ¶
Click to show internal directories.
Click to hide internal directories.