aboutsummaryrefslogtreecommitdiff
path: root/go/game/cardImplementations.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-01-31 00:16:53 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2023-01-31 00:16:53 +0100
commitd76117cc913c738002c7562189ada75748645ff1 (patch)
tree0b0acd248870eb57eee272fa60905fdfc578dd14 /go/game/cardImplementations.go
parent37204e799318a8140372b1fa8e5265e02af3fe96 (diff)
downloadmuhqs-game-d76117cc913c738002c7562189ada75748645ff1.tar.gz
muhqs-game-d76117cc913c738002c7562189ada75748645ff1.zip
intermediate commit
Diffstat (limited to 'go/game/cardImplementations.go')
-rw-r--r--go/game/cardImplementations.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/go/game/cardImplementations.go b/go/game/cardImplementations.go
new file mode 100644
index 00000000..d1f8de70
--- /dev/null
+++ b/go/game/cardImplementations.go
@@ -0,0 +1,31 @@
+package game
+
+type farmerImplementation struct {
+ cardImplementationBase
+}
+
+type advisorImplementation struct {
+ cardImplementationBase
+}
+
+func (impl *advisorImplementation) fullActionPrototypes(u *Unit) []*FullActionPrototype {
+ resolvePrototype := func(s *State, u *Unit) func(*State) {
+ return func(s *State) {
+ controller := u.Controller()
+ controller.DrawN(1)
+ cards := controller.PromptHandCardSelection(0, 1)
+ if cards != nil {
+ controller.Deck.MoveCard(cards[0], s.Exile)
+ }
+ }
+ }
+ return []*FullActionPrototype{NewFullActionPrototype(u, resolvePrototype)}
+}
+
+func init() {
+ cardImplementations = map[string]cardImplementation{
+ "base/advisor": &advisorImplementation{},
+
+ "misc/farmer": &farmerImplementation{},
+ }
+}