aboutsummaryrefslogtreecommitdiff
path: root/go/game/draft.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/draft.go')
-rw-r--r--go/game/draft.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/go/game/draft.go b/go/game/draft.go
index 2b554a82..f180e0ca 100644
--- a/go/game/draft.go
+++ b/go/game/draft.go
@@ -105,19 +105,19 @@ func (ctrl *randomDraftAiCtrl) Player() *Player {
func (ctrl *randomDraftAiCtrl) Close() {
}
-func (ctrl *randomDraftAiCtrl) SendNotification(n PlayerNotification) {
+func (ctrl *randomDraftAiCtrl) SendNotification(n PlayerNotification) error {
ctrl.pack = n.Context.(PileOfCards)
+ return nil
}
-func (ctrl *randomDraftAiCtrl) RecvAction() Action {
- availCards := ctrl.pack.Cards()
- var pick int
- if n := len(availCards); n > 1 {
- pick = rand.Intn(n - 1)
- } else {
- pick = 0
- }
- return NewDraftPick(ctrl.ai, ctrl.pack, availCards[pick])
+func (ctrl *randomDraftAiCtrl) RecvNotification() (n PlayerNotification, err error) { return }
+
+func (ctrl *randomDraftAiCtrl) SendAction(Action) error {
+ return nil
+}
+
+func (ctrl *randomDraftAiCtrl) RecvAction() (Action, error) {
+ return NewDraftPick(ctrl.ai, ctrl.pack, ctrl.pack.RandomCard()), nil
}
func (d *Draft) AddRandomAi() {