Class VoteStatus
- Namespace
- Unity.Multiplayer.Core
What every peer knows about the vote in progress: what is being decided and the counts and countdown an overlay shows, without the voter lists (those stay on the server; each peer learns the ballots separately). Immutable.
public sealed class VoteStatus : IEquatable<VoteStatus>
- Inheritance
-
VoteStatus
- Implements
- Inherited Members
Constructors
VoteStatus(int, string, string, string, long, string, ulong, int, int, int, int, int)
A status with every value given.
public VoteStatus(int sequence, string kind, string title, string description, long number, string text, ulong startedBy, int yes, int no, int voters, int quorum, int secondsLeft)
Parameters
sequenceintkindstringtitlestringdescriptionstringnumberlongtextstringstartedByulongyesintnointvotersintquorumintsecondsLeftint
Properties
Description
An optional second line; empty when the kind has none.
public string Description { get; }
Property Value
Kind
The kind's id.
public string Kind { get; }
Property Value
No
No votes so far.
public int No { get; }
Property Value
Number
The request's number payload.
public long Number { get; }
Property Value
Quorum
Yes votes needed to pass (QuorumFor(int, double)).
public int Quorum { get; }
Property Value
SecondsLeft
Whole seconds until it lapses, rounded up.
public int SecondsLeft { get; }
Property Value
Sequence
Which vote this is: 1 for the session's first, counting up, so a peer can tell a new vote from an update.
public int Sequence { get; }
Property Value
StartedBy
Client id of the player who started it.
public ulong StartedBy { get; }
Property Value
Text
The request's text payload (never null).
public string Text { get; }
Property Value
Title
The question, as the kind words it ("Switch to Level 3?").
public string Title { get; }
Property Value
Undecided
Voters who have voted neither way.
public int Undecided { get; }
Property Value
Voters
How many players may vote (the roster when it started, less anyone who has left since).
public int Voters { get; }
Property Value
Yes
Yes votes so far.
public int Yes { get; }
Property Value
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current object.
Returns
Equals(VoteStatus)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(VoteStatus other)
Parameters
otherVoteStatusAn object to compare with this object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.