revelation of the source

This commit is contained in:
Settel 2021-09-06 21:56:52 +02:00
parent ecfea20df1
commit cd020e4a31
5 changed files with 18 additions and 4 deletions

View File

@ -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

View File

@ -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()
}

View File

@ -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),
},
}
}

View File

@ -40,6 +40,7 @@ type Source struct {
type Revelation struct {
votes map[string][]string
sources map[string]bool
}
type Round struct {

View File

@ -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 {