knowyt/server/src/game/runRound.go

27 lines
494 B
Go
Raw Normal View History

2021-08-15 15:43:00 +00:00
package game
import (
"fmt"
)
func (gm *Game) runRound() {
2021-08-30 16:21:14 +00:00
state, _ := gm.GetState()
2021-10-01 14:40:07 +00:00
if state != STATE_IDLE && state != STATE_PLAY && state != STATE_COLLECT {
fmt.Printf("%s expected state \"IDLE\" | \"PLAY\" | \"COLLECT\" != \"%s\"", gm.GetId(), state)
2021-08-15 15:43:00 +00:00
return
}
err := gm.changeGameState(STATE_ANY, STATE_PLAY, PHASE_SELECT_QUOTE)
if err != nil {
fmt.Println(err)
return
}
errRound := gm.setupRound()
if errRound != nil {
gm.runFinal()
return
}
2021-08-15 15:43:00 +00:00
gm.notifyClients()
}