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 {
|
2022-03-16 08:16:40 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2021-12-03 16:23:42 +00:00
|
|
|
errRound := gm.setupRound()
|
|
|
|
if errRound != nil {
|
|
|
|
gm.runFinal()
|
|
|
|
return
|
|
|
|
}
|
2021-08-15 15:43:00 +00:00
|
|
|
gm.notifyClients()
|
|
|
|
}
|