tally

package
v0.31.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tally added in v0.3.0

type Tally struct {
	// Item is a map of votes ordered by the person being voted for.
	List []*TallyItem `json:"list"`

	Inverted map[*player.Player]*vote.Vote `json:"-"`
	// contains filtered or unexported fields
}

A Tally is a list of players and the votes they have received. It is in descending order by number of votes and by longest held last vote (LHLV).

func New added in v0.3.0

func New(players []*player.Player) *Tally

func (*Tally) Unvote added in v0.3.0

func (t *Tally) Unvote(from *player.Player)

func (*Tally) Vote added in v0.3.0

func (t *Tally) Vote(fp *player.FingerPoint)

type TallyItem

type TallyItem struct {
	Player *player.Player `json:"player"`
	Votes  []*vote.Vote   `json:"votes"`
}

A TallyItem represents a line on a tally: a player and a list of votes.

func NewTallyItem added in v0.3.0

func NewTallyItem(p *player.Player) *TallyItem

func (*TallyItem) AddVote added in v0.3.0

func (i *TallyItem) AddVote(v *vote.Vote)

func (*TallyItem) RemoveVote added in v0.3.0

func (i *TallyItem) RemoveVote(v *vote.Vote)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL