From ea54efacae089aa3644cfe00c8e180d5cc2c8d9e Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 4 Feb 2023 14:37:15 +0100 Subject: support crewing * Introduce new callback for leaving a pile without beeing dropped * Fix equipment contrsuctor * Implement attack inheritance --- go/game/cardParsing.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'go/game/cardParsing.go') diff --git a/go/game/cardParsing.go b/go/game/cardParsing.go index ad0b6ea8..dd64c7b8 100644 --- a/go/game/cardParsing.go +++ b/go/game/cardParsing.go @@ -13,6 +13,7 @@ type parsedCardImplementation struct { genFullActions func(*Unit) []*FullAction genFreeActions func(Permanent) []*FreeAction _onPile func(Permanent) + _onUnpile func(Permanent) _onDrop func(Permanent) } @@ -43,6 +44,12 @@ func (impl *parsedCardImplementation) onPile(p Permanent) { } } +func (impl *parsedCardImplementation) onUnpile(p Permanent) { + if impl._onUnpile != nil { + impl._onUnpile(p) + } +} + func (impl *parsedCardImplementation) onDrop(p Permanent) { if impl._onDrop != nil { impl._onDrop(p) -- cgit v1.2.3