knowyt/server/src/game/runRound.go
2021-09-06 23:18:34 +02:00

23 lines
390 B
Go

package game
import (
"fmt"
)
func (gm *Game) runRound() {
state, _ := gm.GetState()
if state != STATE_IDLE && state != STATE_PLAY {
fmt.Println(fmt.Errorf("expected state \"IDLE\" | \"PLAY\" != \"%s\"", state))
return
}
err := gm.changeGameState(STATE_ANY, STATE_PLAY, PHASE_SELECT_QUOTE)
if err != nil {
fmt.Println(err)
return
}
gm.setupRound()
gm.notifyClients()
}