Barotrauma Client Doc
Barotrauma.Voting Class Reference

Public Types

enum class  VoteState {
  None = 0 , Started = 1 , Running = 2 , Passed = 3 ,
  Failed = 4
}
 

Public Member Functions

int GetVoteCountYes (VoteType voteType)
 
int GetVoteCountNo (VoteType voteType)
 
int GetVoteCountMax (VoteType voteType)
 
void SetVoteCountYes (VoteType voteType, int value)
 
void SetVoteCountNo (VoteType voteType, int value)
 
void SetVoteCountMax (VoteType voteType, int value)
 
void UpdateVoteTexts (IEnumerable< Client > clients, VoteType voteType)
 
void ResetVotes (IEnumerable< Client > connectedClients)
 
bool ClientWrite (IWriteMessage msg, VoteType voteType, object data)
 Returns true if the given data is valid for the given vote type, returns false otherwise. If it returns false, the message must be discarded or reset by the caller, as it is now malformed :) More...
 
void ClientRead (IReadMessage inc)
 

Static Public Member Functions

static T HighestVoted< T > (VoteType voteType, IEnumerable< Client > voters)
 
static T HighestVoted< T > (VoteType voteType, IEnumerable< Client > voters, out int voteCount)
 

Detailed Description

Member Enumeration Documentation

◆ VoteState

Enumerator
None 
Started 
Running 
Passed 
Failed 

Definition at line 8 of file BarotraumaShared/SharedSource/Networking/Voting.cs.

Member Function Documentation

◆ ClientRead()

void Barotrauma.Voting.ClientRead ( IReadMessage  inc)

◆ ClientWrite()

bool Barotrauma.Voting.ClientWrite ( IWriteMessage  msg,
VoteType  voteType,
object  data 
)

Returns true if the given data is valid for the given vote type, returns false otherwise. If it returns false, the message must be discarded or reset by the caller, as it is now malformed :)

Definition at line 134 of file BarotraumaClient/ClientSource/Networking/Voting.cs.

◆ GetVoteCountMax()

int Barotrauma.Voting.GetVoteCountMax ( VoteType  voteType)

◆ GetVoteCountNo()

int Barotrauma.Voting.GetVoteCountNo ( VoteType  voteType)

◆ GetVoteCountYes()

int Barotrauma.Voting.GetVoteCountYes ( VoteType  voteType)

◆ HighestVoted< T >() [1/2]

static T Barotrauma.Voting.HighestVoted< T > ( VoteType  voteType,
IEnumerable< Client voters 
)
static

◆ HighestVoted< T >() [2/2]

static T Barotrauma.Voting.HighestVoted< T > ( VoteType  voteType,
IEnumerable< Client voters,
out int  voteCount 
)
static

◆ ResetVotes()

void Barotrauma.Voting.ResetVotes ( IEnumerable< Client connectedClients)

◆ SetVoteCountMax()

void Barotrauma.Voting.SetVoteCountMax ( VoteType  voteType,
int  value 
)

◆ SetVoteCountNo()

void Barotrauma.Voting.SetVoteCountNo ( VoteType  voteType,
int  value 
)

◆ SetVoteCountYes()

void Barotrauma.Voting.SetVoteCountYes ( VoteType  voteType,
int  value 
)

◆ UpdateVoteTexts()

void Barotrauma.Voting.UpdateVoteTexts ( IEnumerable< Client clients,
VoteType  voteType 
)