diff options
Diffstat (limited to 'go/game/card.go')
| -rw-r--r-- | go/game/card.go | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/go/game/card.go b/go/game/card.go index c1c74490..a6abffd1 100644 --- a/go/game/card.go +++ b/go/game/card.go @@ -80,7 +80,7 @@ type cardImplementation interface { onEntering(*Tile) onLeaving(*Tile) - onPlay(*State, *Player, *Targets) + onPlay(*State, *Card, *Player, *Targets) onPile(containing Permanent) onUnpile(containing Permanent) onDrop(dropped Permanent) @@ -98,12 +98,12 @@ func (*cardImplementationBase) freeActions(Permanent) []*FreeAction { return nil func (*cardImplementationBase) stateBasedActions(*State, Permanent) {} -func (*cardImplementationBase) onEntering(*Tile) {} -func (*cardImplementationBase) onLeaving(*Tile) {} -func (*cardImplementationBase) onPlay(*State, *Player, *Targets) {} -func (*cardImplementationBase) onPile(Permanent) {} -func (*cardImplementationBase) onUnpile(Permanent) {} -func (*cardImplementationBase) onDrop(Permanent) {} +func (*cardImplementationBase) onEntering(*Tile) {} +func (*cardImplementationBase) onLeaving(*Tile) {} +func (*cardImplementationBase) onPlay(*State, *Card, *Player, *Targets) {} +func (*cardImplementationBase) onPile(Permanent) {} +func (*cardImplementationBase) onUnpile(Permanent) {} +func (*cardImplementationBase) onDrop(Permanent) {} // Map of all card implementations var cardImplementations map[string]cardImplementation @@ -312,6 +312,17 @@ func (c *Card) IsPermanent() bool { c.Type == CardTypes.Potion } +func (c *Card) IsToken() bool { + if v, found := c.Values["token"]; found { + b, ok := v.(bool) + if !ok { + log.Fatalf("Invalid value for %s token value: %v", c.Name, v) + } + return b + } + return false +} + func (c *Card) IsBuyable() bool { return c.BuyCost != NOT_BUYABLE } |
