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
|
|
|
|
}
|
|
|
|
|
2021-08-30 08:55:07 +00:00
|
|
|
gm.setupRound()
|
2021-08-15 15:43:00 +00:00
|
|
|
gm.selectQuote()
|
|
|
|
gm.notifyClients()
|
|
|
|
}
|
|
|
|
|
2021-08-30 08:55:07 +00:00
|
|
|
func (gm *Game) setupRound() {
|
|
|
|
gm.mu.Lock()
|
|
|
|
defer gm.mu.Unlock()
|
|
|
|
|
2021-08-30 10:24:28 +00:00
|
|
|
gm.round = Round{
|
|
|
|
selection: make(map[string]string, 0),
|
|
|
|
}
|
2021-08-30 08:55:07 +00:00
|
|
|
}
|
|
|
|
|
2021-08-15 15:43:00 +00:00
|
|
|
func (gm *Game) selectQuote() {
|
|
|
|
gm.mu.Lock()
|
|
|
|
defer gm.mu.Unlock()
|
|
|
|
|
|
|
|
gm.round.quoteId = "455df6bc-070d-4728-83ab-481ceafa8590"
|
2021-08-27 12:43:14 +00:00
|
|
|
gm.round.sources = []Source{
|
|
|
|
{id: "cbc34770-3686-45ee-93bd-c5521e276e21", name: "Herbert Grönemeyer"},
|
|
|
|
{id: "f0422e15-59c7-480b-adea-9e54f8471f02", name: "Frank Sinatra"},
|
|
|
|
{id: "22915112-836e-4a11-b66c-a38a0e0f87b2", name: "Gaius Julius Cäsar"},
|
|
|
|
{id: "f17065b7-88e7-4777-bc48-15770a5b7c83", name: "Thomas Alva Edison"},
|
|
|
|
{id: "b6b3cd30-1d52-4e62-a0bd-bf3847c5c396", name: "Konfuzius"},
|
|
|
|
{id: "c3fc2091-ae0e-433d-b4c3-215a5b57b2b7", name: "George W. Bush jun."},
|
|
|
|
{id: "49514b62-96cf-4ee0-a59a-154c23b7df53", name: "Plato"},
|
2021-08-30 08:55:07 +00:00
|
|
|
{id: "7545ee0f-0447-4c15-adc2-87d85304aeea", name: "Christoph Kolumbus"},
|
2021-08-27 12:43:14 +00:00
|
|
|
{id: "dc20b5f1-23bc-4d80-ab2e-f3caa005064a", name: "Neil Armstrong"},
|
|
|
|
{id: "2b9fbc3c-589f-4176-8708-cc8239e19a4f", name: "Max Planck"},
|
2021-08-15 15:43:00 +00:00
|
|
|
}
|
|
|
|
}
|