knowyt/server/src/game/runRound.go

38 lines
685 B
Go
Raw Normal View History

2021-08-15 15:43:00 +00:00
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.selectQuote()
gm.notifyClients()
}
func (gm *Game) selectQuote() {
gm.mu.Lock()
defer gm.mu.Unlock()
gm.round.quoteId = "455df6bc-070d-4728-83ab-481ceafa8590"
gm.round.sources = []string{
"Herbert Grönemeyer",
"Frank Sinatra",
"Gaius Julius Cäsar",
"Thomas Alva Edison",
"Konfuzius",
"George W. Bush jun.",
}
}