revelation of the source
This commit is contained in:
parent
ecfea20df1
commit
cd020e4a31
@ -52,6 +52,7 @@ func (gm *Game) getSelections() map[string]bool {
|
||||
func (gm *Game) getRevelation() *syncdata.Revelation {
|
||||
revelation := syncdata.Revelation{
|
||||
Votes: gm.round.revelation.votes,
|
||||
Sources: gm.round.revelation.sources,
|
||||
}
|
||||
|
||||
return &revelation
|
||||
|
@ -9,5 +9,15 @@ func (gm *Game) revealSource() {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
gm.mu.Lock()
|
||||
for _, source := range gm.round.sources {
|
||||
gm.round.revelation.sources[source.id] = false
|
||||
}
|
||||
gm.round.revelation.sources["f17065b7-88e7-4777-bc48-15770a5b7c83"] = true
|
||||
// quote := gm.quotes[gm.round.quoteId]
|
||||
// gm.round.revelation.sources[quote.GetSourceId()] = true
|
||||
gm.mu.Unlock()
|
||||
|
||||
gm.notifyClients()
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ func (gm *Game) setupRound() {
|
||||
selections: make(map[string]string, 0),
|
||||
revelation: Revelation{
|
||||
votes: make(map[string][]string, 0),
|
||||
sources: make(map[string]bool, 0),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ type Source struct {
|
||||
|
||||
type Revelation struct {
|
||||
votes map[string][]string
|
||||
sources map[string]bool
|
||||
}
|
||||
|
||||
type Round struct {
|
||||
|
@ -19,6 +19,7 @@ type SourceInfo struct {
|
||||
|
||||
type Revelation struct {
|
||||
Votes map[string][]string `json:"votes"`
|
||||
Sources map[string]bool `json:"sources"`
|
||||
}
|
||||
|
||||
type RoundInfo struct {
|
||||
|
Loading…
Reference in New Issue
Block a user