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 {
|
func (gm *Game) getRevelation() *syncdata.Revelation {
|
||||||
revelation := syncdata.Revelation{
|
revelation := syncdata.Revelation{
|
||||||
Votes: gm.round.revelation.votes,
|
Votes: gm.round.revelation.votes,
|
||||||
|
Sources: gm.round.revelation.sources,
|
||||||
}
|
}
|
||||||
|
|
||||||
return &revelation
|
return &revelation
|
||||||
|
@ -9,5 +9,15 @@ func (gm *Game) revealSource() {
|
|||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
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()
|
gm.notifyClients()
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ func (gm *Game) setupRound() {
|
|||||||
selections: make(map[string]string, 0),
|
selections: make(map[string]string, 0),
|
||||||
revelation: Revelation{
|
revelation: Revelation{
|
||||||
votes: make(map[string][]string, 0),
|
votes: make(map[string][]string, 0),
|
||||||
|
sources: make(map[string]bool, 0),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ type Source struct {
|
|||||||
|
|
||||||
type Revelation struct {
|
type Revelation struct {
|
||||||
votes map[string][]string
|
votes map[string][]string
|
||||||
|
sources map[string]bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Round struct {
|
type Round struct {
|
||||||
|
@ -19,6 +19,7 @@ type SourceInfo struct {
|
|||||||
|
|
||||||
type Revelation struct {
|
type Revelation struct {
|
||||||
Votes map[string][]string `json:"votes"`
|
Votes map[string][]string `json:"votes"`
|
||||||
|
Sources map[string]bool `json:"sources"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RoundInfo struct {
|
type RoundInfo struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user