Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_VotingBase Class Reference
Inheritance diagram for SCR_VotingBase:
SCR_VotingReferendum SCR_VotingAdmin SCR_VotingEditorIn SCR_VotingFactionCommander SCR_VotingFactionCommanderRelieve SCR_VotingFactionCommanderWithdraw SCR_VotingGroupLeader SCR_VotingKick SCR_VotingEditorWithdraw SCR_VotingAutoKick

Protected Member Functions

bool AddPlayerVotedServer (int playerID)
bool RemovePlayerVotedServer (int playerID)
void SetCurrentVoteCount (int currentVoteCount)
int GetCurrentVoteCount ()
int GetJoinServerVoteCooldown ()
int GetServerRuntimeIgnoreJoinServerCooldown ()
int GetVoteCooldownTime ()
int GetAuthorId ()
bool HasCooldown ()
float GetLocalCooldownTimeStamp ()
void SetLocalCooldownTimeStamp (float newTimeStamp)
bool HasInitiatedVotingLocallyOnce ()
void SetHasInitiatedVotingLocallyOnce ()
 Set Has initiated voting locally at least once to true.
void SetVote (int playerID, int value=DEFAULT_VALUE)
bool RemoveVote (int playerID)
bool RemoveValue (int value)
bool CanSendNotification (int value)
bool Evaluate (out EVotingOutcome outcome)
int GetWinner ()
bool ShouldCancelWhenSubjectLeavesTheServer ()
void OnVotingEnd (int value=DEFAULT_VALUE, int winner=DEFAULT_VALUE)
int GetPlayerVote (int playerID)
bool IsAvailable (int value, bool isOngoing)
bool IsMatching (EVotingType type, int value=DEFAULT_VALUE)
void Log ()
string GetValueName (int value)
EVotingType GetType ()
EVotingType GetValue ()
SCR_VotingUIInfo GetInfo ()
float GetRemainingDuration ()
bool IsValuePlayerID ()
void SetVoteLocal (int value)
void RemoveVoteLocal ()
int GetLocalVote ()
bool GetAlwaysDisplayVoteSubjectVotingTimer ()
bool GetAlwaysDisplayVoteInitiatorVotingTimer ()
void Update (float timeSlice)
void InitFromTemplate (SCR_VotingBase template, int startingPlayerID, int value, float remainingDuration)
int GetPlayerCount ()
int GetVoteCountRequired ()
bool EvaluateParticipation (int voteCount)

Protected Attributes

EVotingType m_Type
bool m_bIsValuePlayerID
bool m_bCancelWhenSubjectLeavesTheServer
float m_fDuration
float m_fThreshold
float m_iMinParticipation
int m_iMinVotes
ref SCR_VotingUIInfo m_Info
int m_iJoinServerVoteCooldown
int m_iServerRuntimeIgnoreJoinServerCooldown
int m_iVoteCooldownTime
bool m_bAlwaysDisplayVoteSubjectVotingTimer
bool m_bAlwaysDisplayVoteInitiatorVotingTimer
float m_fVoteCooldownTimeStamp = -1
bool m_bHasInitiatedVotingLocallyOnce
int m_iVoteAuthorId
int m_iLocalValue = DEFAULT_VALUE
int m_iCurrentVoteCount
ref array< intm_aPlayersVoted_Server = {}

Static Protected Attributes

static const int DEFAULT_VALUE = -1
static const int ALTERNATIVE_VALUE = -2
 Value of the vote, that is used when vote ends in an alternative solution.

Detailed Description

Base class for voting types. Do not expose objects of this class outside of SCR_VotingManagerComponent! Other systems should always go through the manager.

Definition at line 5 of file SCR_VotingBase.c.

Member Function Documentation

◆ AddPlayerVotedServer()

bool SCR_VotingBase::AddPlayerVotedServer ( int playerID)
inlineprotected

A player has voted to approve (server only)

Parameters
[in]playerIDId of player who voted
Returns
True if player had not yet voted to approve

Definition at line 66 of file SCR_VotingBase.c.

◆ CanSendNotification()

bool SCR_VotingBase::CanSendNotification ( int value)
inlineprotected

Check if notification can be shown for this voting

Parameters
[in]valueVoting value
Returns
True if can send notification for this voting type

Definition at line 206 of file SCR_VotingBase.c.

◆ Evaluate()

bool SCR_VotingBase::Evaluate ( out EVotingOutcome outcome)
inlineprotected

Evaluate if the voting can end.

Parameters
[out]outcomeOutcome of the vote (used only when returned value is true)
Returns
True if it can end

Definition at line 215 of file SCR_VotingBase.c.

◆ EvaluateParticipation()

bool SCR_VotingBase::EvaluateParticipation ( int voteCount)
inlineprotected

Definition at line 424 of file SCR_VotingBase.c.

◆ GetAlwaysDisplayVoteInitiatorVotingTimer()

bool SCR_VotingBase::GetAlwaysDisplayVoteInitiatorVotingTimer ( )
inlineprotected
Returns

Definition at line 359 of file SCR_VotingBase.c.

◆ GetAlwaysDisplayVoteSubjectVotingTimer()

bool SCR_VotingBase::GetAlwaysDisplayVoteSubjectVotingTimer ( )
inlineprotected
Returns

Definition at line 352 of file SCR_VotingBase.c.

◆ GetAuthorId()

int SCR_VotingBase::GetAuthorId ( )
inlineprotected
Returns
playerId of the player who started the vote

Definition at line 136 of file SCR_VotingBase.c.

◆ GetCurrentVoteCount()

int SCR_VotingBase::GetCurrentVoteCount ( )
inlineprotected
Returns
Current total votes the vote has received

Definition at line 108 of file SCR_VotingBase.c.

◆ GetInfo()

SCR_VotingUIInfo SCR_VotingBase::GetInfo ( )
inlineprotected

Get voting UI representation

Returns
UI info

Definition at line 305 of file SCR_VotingBase.c.

◆ GetJoinServerVoteCooldown()

int SCR_VotingBase::GetJoinServerVoteCooldown ( )
inlineprotected
Returns
The voting delay cooldown when a player joins the server. How long

Definition at line 115 of file SCR_VotingBase.c.

◆ GetLocalCooldownTimeStamp()

float SCR_VotingBase::GetLocalCooldownTimeStamp ( )
inlineprotected
Returns
Get the last cooldown (Either when joining server or last voted)

Definition at line 153 of file SCR_VotingBase.c.

◆ GetLocalVote()

int SCR_VotingBase::GetLocalVote ( )
inlineprotected

Get local vote. It is purely informative and does not affect voting outcome!

Returns
Voted value

Definition at line 345 of file SCR_VotingBase.c.

◆ GetPlayerCount()

int SCR_VotingBase::GetPlayerCount ( )
inlineprotected

Get total player count of players that are valid to vote for the issue

Returns
Total count

Definition at line 400 of file SCR_VotingBase.c.

◆ GetPlayerVote()

int SCR_VotingBase::GetPlayerVote ( int playerID)
inlineprotected
Parameters
[in]playerID
Returns

Definition at line 245 of file SCR_VotingBase.c.

◆ GetRemainingDuration()

float SCR_VotingBase::GetRemainingDuration ( )
inlineprotected
Returns
Remaining time of the voting in seconds

Definition at line 311 of file SCR_VotingBase.c.

◆ GetServerRuntimeIgnoreJoinServerCooldown()

int SCR_VotingBase::GetServerRuntimeIgnoreJoinServerCooldown ( )
inlineprotected
Returns
Get the server vote delay ignore time. It will not set a server vote delay time when the player joins if the server has started less seconds ago than this

Definition at line 122 of file SCR_VotingBase.c.

◆ GetType()

EVotingType SCR_VotingBase::GetType ( )
inlineprotected

Get voting type.

Returns
Type

Definition at line 288 of file SCR_VotingBase.c.

◆ GetValue()

EVotingType SCR_VotingBase::GetValue ( )
inlineprotected

Get voting value. Applicable only if the voting targets specific value, e.g., is referendum about certain outcome.

Returns
Value

Definition at line 297 of file SCR_VotingBase.c.

◆ GetValueName()

string SCR_VotingBase::GetValueName ( int value)
inlineprotected

Get name of the value.

Parameters
[in]value
Returns
Value name

Definition at line 277 of file SCR_VotingBase.c.

◆ GetVoteCooldownTime()

int SCR_VotingBase::GetVoteCooldownTime ( )
inlineprotected
Returns
Get the cooldown amount between voting

Definition at line 129 of file SCR_VotingBase.c.

◆ GetVoteCountRequired()

int SCR_VotingBase::GetVoteCountRequired ( )
inlineprotected

Get total players needed to make sure the vote is successfull

Returns
Total votes needed

Definition at line 408 of file SCR_VotingBase.c.

◆ GetWinner()

int SCR_VotingBase::GetWinner ( )
inlineprotected

Get winner of the vote.

Returns
Winning value

Definition at line 223 of file SCR_VotingBase.c.

◆ HasCooldown()

bool SCR_VotingBase::HasCooldown ( )
inlineprotected
Returns
Return if the Vote has a cooldown set. Will use the join cooldown if not yet initiated voting

Definition at line 143 of file SCR_VotingBase.c.

◆ HasInitiatedVotingLocallyOnce()

bool SCR_VotingBase::HasInitiatedVotingLocallyOnce ( )
inlineprotected
Returns
True if a player has initiated voted locally at least once for this vote

Definition at line 168 of file SCR_VotingBase.c.

◆ InitFromTemplate()

void SCR_VotingBase::InitFromTemplate ( SCR_VotingBase template,
int startingPlayerID,
int value,
float remainingDuration )
inlineprotected

Initialise voting from given template.

Parameters
[in]templateSource template
[in]startingPlayerIDid of a player who started the vote
[in]valueTarget value
[in]remainingDurationRemaining time until the voting ends in seconds (-1 to use default)

Definition at line 378 of file SCR_VotingBase.c.

◆ IsAvailable()

bool SCR_VotingBase::IsAvailable ( int value,
bool isOngoing )
inlineprotected

Check if the voting is available in the current world.

Parameters
[in]valuePotential voting value
[in]isOngoingTrue if the voting was already initiated
Returns
True when available

Definition at line 257 of file SCR_VotingBase.c.

◆ IsMatching()

bool SCR_VotingBase::IsMatching ( EVotingType type,
int value = DEFAULT_VALUE )
protected

Check if the voting is matching given params.

Parameters
[in]typeVoting type
[in]valueVoting value
Returns

◆ IsValuePlayerID()

bool SCR_VotingBase::IsValuePlayerID ( )
inlineprotected

Check if the voting is about player IDs.

Returns
True when it's about player IDs

Definition at line 319 of file SCR_VotingBase.c.

◆ Log()

void SCR_VotingBase::Log ( )
protected

◆ OnVotingEnd()

void SCR_VotingBase::OnVotingEnd ( int value = DEFAULT_VALUE,
int winner = DEFAULT_VALUE )
protected

Event called when the voting ends.

Parameters
[in]valueVoting value
[in]winnerWinning value

◆ RemovePlayerVotedServer()

bool SCR_VotingBase::RemovePlayerVotedServer ( int playerID)
inlineprotected

A player has voted to remove or abstain (server only)

Parameters
[in]playerIDId of player who voted to remove or abstain
Returns
True if player had previously voted to approve and the vote was removed

Definition at line 84 of file SCR_VotingBase.c.

◆ RemoveValue()

bool SCR_VotingBase::RemoveValue ( int value)
protected

Remove all votes for given value.

Parameters
[in]valueValue
Returns

◆ RemoveVote()

bool SCR_VotingBase::RemoveVote ( int playerID)
protected

Remove vote of given player.

Parameters
[in]playerIDPlayer ID
Returns
True if the voting should be cancelled

◆ RemoveVoteLocal()

void SCR_VotingBase::RemoveVoteLocal ( )
inlineprotected

Remove local vote. It is purely informative and does not affect voting outcome!

Definition at line 336 of file SCR_VotingBase.c.

◆ SetCurrentVoteCount()

void SCR_VotingBase::SetCurrentVoteCount ( int currentVoteCount)
inlineprotected

Set the current amount of votes this vote has

Parameters
[in]currentVoteCountNew current vote amount

Definition at line 101 of file SCR_VotingBase.c.

◆ SetHasInitiatedVotingLocallyOnce()

void SCR_VotingBase::SetHasInitiatedVotingLocallyOnce ( )
inlineprotected

Set Has initiated voting locally at least once to true.

Definition at line 175 of file SCR_VotingBase.c.

◆ SetLocalCooldownTimeStamp()

void SCR_VotingBase::SetLocalCooldownTimeStamp ( float newTimeStamp)
inlineprotected

Set the time stamp for cooldowns for this voting param[in] New Time stamp to set

Definition at line 161 of file SCR_VotingBase.c.

◆ SetVote()

void SCR_VotingBase::SetVote ( int playerID,
int value = DEFAULT_VALUE )
protected

Set vote of given player.

Parameters
[in]playerIDPlayer ID
[in]valueCast vote

◆ SetVoteLocal()

void SCR_VotingBase::SetVoteLocal ( int value)
inlineprotected

Save local vote. It's purely informative, does not affect voting outcome!

Parameters
[in]valueVoted value

Definition at line 328 of file SCR_VotingBase.c.

◆ ShouldCancelWhenSubjectLeavesTheServer()

bool SCR_VotingBase::ShouldCancelWhenSubjectLeavesTheServer ( )
inlineprotected
Returns
true if vote should be cancled when subject of the server leaves the server

Definition at line 230 of file SCR_VotingBase.c.

◆ Update()

void SCR_VotingBase::Update ( float timeSlice)
inlineprotected

Periodically update the voting.

Parameters
[in]timeSliceTime since the last update

Definition at line 367 of file SCR_VotingBase.c.

Member Data Documentation

◆ ALTERNATIVE_VALUE

const int SCR_VotingBase::ALTERNATIVE_VALUE = -2
staticprotected

Value of the vote, that is used when vote ends in an alternative solution.

Definition at line 51 of file SCR_VotingBase.c.

◆ DEFAULT_VALUE

const int SCR_VotingBase::DEFAULT_VALUE = -1
staticprotected

Definition at line 49 of file SCR_VotingBase.c.

◆ m_aPlayersVoted_Server

ref array<int> SCR_VotingBase::m_aPlayersVoted_Server = {}
protected

Definition at line 60 of file SCR_VotingBase.c.

◆ m_bAlwaysDisplayVoteInitiatorVotingTimer

bool SCR_VotingBase::m_bAlwaysDisplayVoteInitiatorVotingTimer
protected

Definition at line 44 of file SCR_VotingBase.c.

◆ m_bAlwaysDisplayVoteSubjectVotingTimer

bool SCR_VotingBase::m_bAlwaysDisplayVoteSubjectVotingTimer
protected

Definition at line 41 of file SCR_VotingBase.c.

◆ m_bCancelWhenSubjectLeavesTheServer

bool SCR_VotingBase::m_bCancelWhenSubjectLeavesTheServer
protected

Definition at line 14 of file SCR_VotingBase.c.

◆ m_bHasInitiatedVotingLocallyOnce

bool SCR_VotingBase::m_bHasInitiatedVotingLocallyOnce
protected

Definition at line 47 of file SCR_VotingBase.c.

◆ m_bIsValuePlayerID

bool SCR_VotingBase::m_bIsValuePlayerID
protected

Definition at line 11 of file SCR_VotingBase.c.

◆ m_fDuration

float SCR_VotingBase::m_fDuration
protected

Definition at line 17 of file SCR_VotingBase.c.

◆ m_fThreshold

float SCR_VotingBase::m_fThreshold
protected

Definition at line 20 of file SCR_VotingBase.c.

◆ m_fVoteCooldownTimeStamp

float SCR_VotingBase::m_fVoteCooldownTimeStamp = -1
protected

Definition at line 46 of file SCR_VotingBase.c.

◆ m_iCurrentVoteCount

int SCR_VotingBase::m_iCurrentVoteCount
protected

Definition at line 57 of file SCR_VotingBase.c.

◆ m_iJoinServerVoteCooldown

int SCR_VotingBase::m_iJoinServerVoteCooldown
protected

Definition at line 32 of file SCR_VotingBase.c.

◆ m_iLocalValue

int SCR_VotingBase::m_iLocalValue = DEFAULT_VALUE
protected

Definition at line 54 of file SCR_VotingBase.c.

◆ m_iMinParticipation

float SCR_VotingBase::m_iMinParticipation
protected

Definition at line 23 of file SCR_VotingBase.c.

◆ m_iMinVotes

int SCR_VotingBase::m_iMinVotes
protected

Definition at line 26 of file SCR_VotingBase.c.

◆ m_Info

ref SCR_VotingUIInfo SCR_VotingBase::m_Info
protected

Definition at line 29 of file SCR_VotingBase.c.

◆ m_iServerRuntimeIgnoreJoinServerCooldown

int SCR_VotingBase::m_iServerRuntimeIgnoreJoinServerCooldown
protected

Definition at line 35 of file SCR_VotingBase.c.

◆ m_iVoteAuthorId

int SCR_VotingBase::m_iVoteAuthorId
protected

Definition at line 53 of file SCR_VotingBase.c.

◆ m_iVoteCooldownTime

int SCR_VotingBase::m_iVoteCooldownTime
protected

Definition at line 38 of file SCR_VotingBase.c.

◆ m_Type

EVotingType SCR_VotingBase::m_Type
protected

Definition at line 8 of file SCR_VotingBase.c.


The documentation for this class was generated from the following file: