Documentation
¶
Index ¶
- Constants
- type Participant
- type Room
- func (room *Room) CloseVote()
- func (room Room) DisplayVotersStatus() []string
- func (room Room) FilterVoteData(voterId uuid.UUID) *Room
- func (room Room) NbVotesReceived() int
- func (room *Room) OpenVote()
- func (room Room) TurnFinishedCommands() map[string]string
- func (room Room) TurnStartedCommands() map[string]string
- func (room *Room) UpdateFromHub()
- func (room *Room) UpdateFromParticipant(voterReceived Participant)
- func (room Room) VoteCommands() map[string]string
- type RoomVoteStatus
Constants ¶
View Source
const ( VoteOpen = iota VoteClosed )
View Source
const ( CommandQuit = "q" CommandNotVoting = "n" CommandStartVote = "s" CommandCloseVote = "v" CommandVote1 = "1" CommandVote2 = "2" CommandVote3 = "3" CommandVote5 = "5" CommandVote8 = "8" CommandVote13 = "d" CommandVote21 = "m" )
commands and associated keyboard shortcuts
View Source
const ( VoteReceived = "r" VoteNotReceived = "" VoteHidden = "-" )
vote status
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Participant ¶
type Participant struct { Id uuid.UUID `json:"id"` Name string `json:"name"` Vote string `json:"vote"` AvailableCommands map[string]string `json:"available_commands"` LastCommand string `json:"last_command"` }
func CreateVoter ¶
func CreateVoter(voterName string) *Participant
func (*Participant) UpdateLocalPlayerFromServer ¶
func (localVoter *Participant) UpdateLocalPlayerFromServer(roomFromServer *Room)
for local participant apply server updates to keep display up to date
type Room ¶
type Room struct { RoomStatus RoomVoteStatus `json:"roomStatus"` Voters []*Participant `json:"voters"` // contains filtered or unexported fields }
func (Room) DisplayVotersStatus ¶
func (Room) FilterVoteData ¶
hide votes if the vote is not closed
func (Room) NbVotesReceived ¶
func (Room) TurnFinishedCommands ¶
func (Room) TurnStartedCommands ¶
func (*Room) UpdateFromHub ¶
func (room *Room) UpdateFromHub()
func (*Room) UpdateFromParticipant ¶
func (room *Room) UpdateFromParticipant(voterReceived Participant)
func (Room) VoteCommands ¶
type RoomVoteStatus ¶
type RoomVoteStatus int
Click to show internal directories.
Click to hide internal directories.