Move to entity structs

This commit is contained in:
Bel LaPointe
2021-03-16 22:40:26 -05:00
parent 3a8985486a
commit 3e71ab6217
11 changed files with 179 additions and 25 deletions

17
src/entity/hand.go Normal file
View File

@@ -0,0 +1,17 @@
package entity
type Hand struct {
Public []Card
Private []Card
}
func (hand *Hand) Push(card Card) {
if hand.Public == nil {
hand.Public = make([]Card, 0, 1)
}
hand.Public = append(hand.Public, card)
}
func (hand Hand) Len() int {
return len(hand.Public) + len(hand.Private)
}