Class Vote

Namespace
Unity.Multiplayer.Core

A running vote on the server, as its Passed effect and Current see it. The roster when it started (less anyone the kind leaves out) is its voter list; it passes once Yes reaches Quorum and is rejected as soon as it no longer can. Players are identified by their network client id. Only the VoteBox changes it.

public sealed class Vote
Inheritance
Vote
Inherited Members

Properties

CannotPass

True once Yes can no longer reach the quorum, even if every undecided voter says Yes.

public bool CannotPass { get; }

Property Value

bool

Description

The optional second line; empty when there is none.

public string Description { get; }

Property Value

string

HasPassed

True once Yes has reached the quorum.

public bool HasPassed { get; }

Property Value

bool

Kind

What is being voted on.

public VoteKind Kind { get; }

Property Value

VoteKind

No

The voters who said No.

public IReadOnlyList<ulong> No { get; }

Property Value

IReadOnlyList<ulong>

Number

The request's number payload.

public long Number { get; }

Property Value

long

Quorum

Yes votes needed to pass, recomputed whenever a voter leaves.

public int Quorum { get; }

Property Value

int

QuorumFraction

The fraction Quorum is taken of.

public double QuorumFraction { get; }

Property Value

double

Request

The request as the starter sent it.

public VoteRequest Request { get; }

Property Value

VoteRequest

Sequence

1 for the box's first vote, counting up.

public int Sequence { get; }

Property Value

int

StartedAtTick

The clock tick it started on.

public long StartedAtTick { get; }

Property Value

long

StartedBy

Client id of the player who started it.

public ulong StartedBy { get; }

Property Value

ulong

Text

The request's text payload (never null).

public string Text { get; }

Property Value

string

TimeoutTicks

How many ticks it runs before it lapses.

public long TimeoutTicks { get; }

Property Value

long

Title

The question, worded when it started.

public string Title { get; }

Property Value

string

Undecided

Voters who have voted neither way.

public int Undecided { get; }

Property Value

int

Voters

Who may vote: the roster at the start, less the kind's exclusions and anyone who has left since.

public IReadOnlyList<ulong> Voters { get; }

Property Value

IReadOnlyList<ulong>

Yes

The voters who said Yes.

public IReadOnlyList<ulong> Yes { get; }

Property Value

IReadOnlyList<ulong>

Methods

ChoiceOf(ulong)

Where player stands on it.

public VoteChoice ChoiceOf(ulong player)

Parameters

player ulong

Returns

VoteChoice

IsExpired(long)

True once its time has run out at nowTick.

public bool IsExpired(long nowTick)

Parameters

nowTick long

Returns

bool

ResultOf(VoteEnding)

How it ended, for every peer.

public VoteResult ResultOf(VoteEnding ending)

Parameters

ending VoteEnding

Returns

VoteResult

SecondsLeft(long, int)

Whole seconds until it lapses at nowTick, rounded up (a countdown that shows 15 at the start and 0 once over).

public int SecondsLeft(long nowTick, int tickRate)

Parameters

nowTick long
tickRate int

Returns

int

StatusAt(long, int)

What every peer is told about it at nowTick.

public VoteStatus StatusAt(long nowTick, int tickRate)

Parameters

nowTick long
tickRate int

Returns

VoteStatus

TicksLeft(long)

Ticks until it lapses at nowTick; 0 once it has.

public long TicksLeft(long nowTick)

Parameters

nowTick long

Returns

long

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.