knowyt/server/src/game/runRound.go

23 lines
430 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.Println(fmt.Errorf("expected state \"IDLE\" | \"PLAY\" | \"COLLECT\" != \"%s\"", 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
}
2021-08-30 08:55:07 +00:00
gm.setupRound()
2021-08-15 15:43:00 +00:00
gm.notifyClients()
}