diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-03-25 16:58:11 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:55 +0100 |
| commit | c402f4755744b26840f8c21326448243fde4c3b0 (patch) | |
| tree | 3e6626d46f6b0290e75b93b6119a63e367cd5bc8 /go | |
| parent | 0229868f43c09b3e0a89182dc0214984b089c3e4 (diff) | |
| download | muhqs-game-c402f4755744b26840f8c21326448243fde4c3b0.tar.gz muhqs-game-c402f4755744b26840f8c21326448243fde4c3b0.zip | |
add onETB card hook
Diffstat (limited to 'go')
| -rw-r--r-- | go/game/card.go | 2 | ||||
| -rw-r--r-- | go/game/cardParsing.go | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/go/game/card.go b/go/game/card.go index a7b9cc52..e52ad3dc 100644 --- a/go/game/card.go +++ b/go/game/card.go @@ -103,6 +103,7 @@ type cardImplementation interface { onEntering(*Tile) onLeaving(*Tile) onPlay(*State, *Card, *Player, *Targets) + onETB(*State, Permanent) onPile(containing Permanent) onUnpile(containing Permanent) onDrop(dropped Permanent) @@ -127,6 +128,7 @@ func (*cardImplementationBase) additionalSpawnsFor(Permanent, CardType) []*Tile func (*cardImplementationBase) onEntering(*Tile) {} func (*cardImplementationBase) onLeaving(*Tile) {} func (*cardImplementationBase) onPlay(*State, *Card, *Player, *Targets) {} +func (*cardImplementationBase) onETB(*State, Permanent) {} func (*cardImplementationBase) onPile(Permanent) {} func (*cardImplementationBase) onUnpile(Permanent) {} func (*cardImplementationBase) onDrop(Permanent) {} diff --git a/go/game/cardParsing.go b/go/game/cardParsing.go index b14f3f96..2a53926e 100644 --- a/go/game/cardParsing.go +++ b/go/game/cardParsing.go @@ -22,6 +22,7 @@ type dynamicCardImplementation struct { _onEntering func(*Tile) _onLeaving func(*Tile) _onPlay func(*State, *Card, *Player, *Targets) + _onETB func(*State, Permanent) _onPile func(Permanent) _onUnpile func(Permanent) _onDrop func(Permanent) @@ -83,6 +84,12 @@ func (impl *dynamicCardImplementation) onPlay(s *State, c *Card, p *Player, t *T } } +func (impl *dynamicCardImplementation) onETB(s *State, p Permanent) { + if impl._onETB != nil { + impl._onETB(s, p) + } +} + func (impl *dynamicCardImplementation) onPile(p Permanent) { if impl._onPile != nil { impl._onPile(p) |
