aboutsummaryrefslogtreecommitdiff
path: root/go/game/playerControl_test.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-08-12 08:28:31 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-12 08:28:31 +0200
commit8e87600190430bde15429f9aa2bf6d1dff2a8daa (patch)
treec197c2fe8f92a65096e00bff0c21e230ac127f68 /go/game/playerControl_test.go
parent74ae5a066cabed76aa617e04736f62d60300ec44 (diff)
downloadmuhqs-game-8e87600190430bde15429f9aa2bf6d1dff2a8daa.tar.gz
muhqs-game-8e87600190430bde15429f9aa2bf6d1dff2a8daa.zip
git enforce slow action timing restrictions
Diffstat (limited to 'go/game/playerControl_test.go')
-rw-r--r--go/game/playerControl_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/go/game/playerControl_test.go b/go/game/playerControl_test.go
index 34f20c59..37f5e919 100644
--- a/go/game/playerControl_test.go
+++ b/go/game/playerControl_test.go
@@ -4,6 +4,29 @@ import (
"testing"
)
+type MockPlayerControl struct {
+ p *Player
+ sentNotifications []PlayerNotification
+}
+
+func newMockPlayerControl(p *Player) PlayerControl {
+ return &MockPlayerControl{p: p}
+}
+
+func (ctrl *MockPlayerControl) Close() {}
+func (ctrl *MockPlayerControl) Player() *Player { return ctrl.p }
+func (ctrl *MockPlayerControl) RecvNotification() (n PlayerNotification, err error) {
+ return
+}
+func (ctrl *MockPlayerControl) SendNotification(n PlayerNotification) error {
+ ctrl.sentNotifications = append(ctrl.sentNotifications, n)
+ return nil
+}
+func (ctrl *MockPlayerControl) RecvAction() (Action, error) {
+ return nil, nil
+}
+func (ctrl *MockPlayerControl) SendAction(Action) error { return nil }
+
const PRORITY_STRING = "!priority{}"
func TestMarshalPriority(t *testing.T) {