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

sequence int
kind string
title string
description string
number long
text string
startedBy ulong
yes int
no int
voters int
quorum int
secondsLeft int

Properties

Description

An optional second line; empty when the kind has none.

public string Description { get; }

Property Value

string

Kind

The kind's id.

public string Kind { get; }

Property Value

string

No

No votes so far.

public int No { get; }

Property Value

int

Number

The request's number payload.

public long Number { get; }

Property Value

long

Quorum

Yes votes needed to pass (QuorumFor(int, double)).

public int Quorum { get; }

Property Value

int

SecondsLeft

Whole seconds until it lapses, rounded up.

public int SecondsLeft { get; }

Property Value

int

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

int

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

Title

The question, as the kind words it ("Switch to Level 3?").

public string Title { get; }

Property Value

string

Undecided

Voters who have voted neither way.

public int Undecided { get; }

Property Value

int

Voters

How many players may vote (the roster when it started, less anyone who has left since).

public int Voters { get; }

Property Value

int

Yes

Yes votes so far.

public int Yes { get; }

Property Value

int

Methods

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(VoteStatus)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(VoteStatus other)

Parameters

other VoteStatus

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

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.