diff options
Diffstat (limited to 'go/game/store.go')
| -rw-r--r-- | go/game/store.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/go/game/store.go b/go/game/store.go index 46c136e0..73153980 100644 --- a/go/game/store.go +++ b/go/game/store.go @@ -1,5 +1,9 @@ package game +import ( + "log" +) + type Store struct { PileOfCardsBase } @@ -8,3 +12,10 @@ func NewStore() *Store { s := &Store{PileOfCardsBase{[]*Card{}}} return s } + +func (s *Store) AddCard(card *Card) { + if !card.IsBuyable() { + log.Fatalf("Non buyable card %s can not be added to a store", card.Name) + } + s.PileOfCardsBase.AddCard(card) +} |
