diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-08-03 19:41:20 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:53 +0100 |
| commit | 5caa446e8d95bb55c66cd79b5fb10e6f7cf61aec (patch) | |
| tree | dd496091bcce132f1384ccc67951619862d4868e /go/game/action.go | |
| parent | d63c4bf273011945455d18b5444890c16db0396c (diff) | |
| download | muhqs-game-5caa446e8d95bb55c66cd79b5fb10e6f7cf61aec.tar.gz muhqs-game-5caa446e8d95bb55c66cd79b5fb10e6f7cf61aec.zip | |
add skeleton for triggers and triggered actions
Diffstat (limited to 'go/game/action.go')
| -rw-r--r-- | go/game/action.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/go/game/action.go b/go/game/action.go index fbabb06b..4f433845 100644 --- a/go/game/action.go +++ b/go/game/action.go @@ -79,6 +79,29 @@ func (a *ActionBase) CheckTargets(s *State) error { return a.targets.CheckTargets(s) } +type TriggeredAction struct { + ActionBase + event Event +} + +func newTriggeredAction(event Event, source Trigger, resolveFunc ActionResolveFunc, + costFunc ActionCostFunc, +) *TriggeredAction { + return &TriggeredAction{ + ActionBase: ActionBase{ + source: source, + Card: source.Card(), + resolveFunc: resolveFunc, + costFunc: costFunc, + }, + event: event, + } +} + +func (a *TriggeredAction) String() string { + return fmt.Sprintf("%v ! %v", a.event, a.source) +} + type PileDropAction struct { ActionBase pile []Permanent |
