revelation of the source
This commit is contained in:
parent
ecfea20df1
commit
cd020e4a31
@ -51,7 +51,8 @@ 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()
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,8 @@ func (gm *Game) setupRound() {
|
|||||||
gm.round = Round{
|
gm.round = Round{
|
||||||
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),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,8 @@ 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 {
|
||||||
|
@ -18,7 +18,8 @@ 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