why do cuffs not work

This commit is contained in:
Branden J Brown 2024-02-03 13:36:06 -06:00
parent 11eff6b755
commit 76195d21cb
2 changed files with 6 additions and 2 deletions

View File

@ -11,6 +11,7 @@ package game
import ( import (
"errors" "errors"
"log/slog"
"git.sunturtle.xyz/studio/shotgun/player" "git.sunturtle.xyz/studio/shotgun/player"
"git.sunturtle.xyz/studio/shotgun/serve" "git.sunturtle.xyz/studio/shotgun/serve"
@ -94,6 +95,7 @@ func (g *Match) NextTurn() {
g.reveal = false g.reveal = false
cur := g.CurrentPlayer() cur := g.CurrentPlayer()
skip := cur.cuffs == CuffedSkip skip := cur.cuffs == CuffedSkip
slog.Info("next turn", "skip", skip, "cuffs", cur.cuffs)
cur.cuffs = cur.cuffs.NextState() cur.cuffs = cur.cuffs.NextState()
if skip { if skip {
g.NextTurn() g.NextTurn()

View File

@ -56,6 +56,8 @@ const (
) )
func (c CuffState) NextState() CuffState { func (c CuffState) NextState() CuffState {
var m = [...]CuffState{Uncuffed, Uncuffed, Cuffed} if c != Uncuffed {
return m[c] c--
}
return c
} }