|
Arma Reforger Script API
|
Referendum about specific outcome. More...
Public Member Functions | |
| override bool | AddPlayerVotedServer (int playerID) |
| A player has voted to approve (server only) | |
| override bool | RemovePlayerVotedServer (int playerID) |
| A player has voted to remove or abstain (server only) | |
| override void | SetVote (int playerID, int value=DEFAULT_VALUE) |
| Set vote of given player. | |
| override bool | RemoveVote (int playerID) |
| Remove vote of given player. | |
| override bool | RemoveValue (int value) |
| Remove all votes for given value. | |
| override bool | IsMatching (EVotingType type, int value=DEFAULT_VALUE) |
| Check if the voting is matching given params. | |
| override bool | Evaluate (out EVotingOutcome outcome) |
| Evaluate if the voting can end. | |
| override int | GetWinner () |
| Get winner of the vote. | |
| override int | GetPlayerVote (int playerID) |
| override int | GetValue () |
| Get voting value. | |
| override void | Log () |
| override void | InitFromTemplate (SCR_VotingBase template, int startingPlayerID, int value, float remainingDuration) |
| Initialise voting from given template. | |
Public Member Functions inherited from SCR_VotingBase | |
| void | SetCurrentVoteCount (int currentVoteCount) |
| Set the current amount of votes this vote has. | |
| int | GetCurrentVoteCount () |
| int | GetJoinServerVoteCooldown () |
| int | GetServerRuntimeIgnoreJoinServerCooldown () |
| int | GetVoteCooldownTime () |
| int | GetAuthorId () |
| bool | HasCooldown () |
| float | GetLocalCooldownTimeStamp () |
| void | SetLocalCooldownTimeStamp (float newTimeStamp) |
| Set the time stamp for cooldowns for this voting param[in] New Time stamp to set. | |
| bool | HasInitiatedVotingLocallyOnce () |
| void | SetHasInitiatedVotingLocallyOnce () |
| Set Has initiated voting locally at least once to true. | |
| bool | CanSendNotification (int value) |
| Check if notification can be shown for this voting. | |
| bool | ShouldCancelWhenSubjectLeavesTheServer () |
| void | OnVotingEnd (int value=DEFAULT_VALUE, int winner=DEFAULT_VALUE) |
| Event called when the voting ends. | |
| bool | IsAvailable (int value, bool isOngoing) |
| Check if the voting is available in the current world. | |
| string | GetValueName (int value) |
| Get name of the value. | |
| EVotingType | GetType () |
| Get voting type. | |
| SCR_VotingUIInfo | GetInfo () |
| Get voting UI representation. | |
| float | GetRemainingDuration () |
| bool | IsValuePlayerID () |
| Check if the voting is about player IDs. | |
| void | SetVoteLocal (int value) |
| Save local vote. | |
| void | RemoveVoteLocal () |
| Remove local vote. | |
| int | GetLocalVote () |
| Get local vote. | |
| bool | GetAlwaysDisplayVoteSubjectVotingTimer () |
| void | Update (float timeSlice) |
| Periodically update the voting. | |
| int | GetPlayerCount () |
| Get total player count of players that are valid to vote for the issue. | |
| int | GetVoteCountRequired () |
| Get total players needed to make sure the vote is successfull. | |
Protected Member Functions | |
| float | GetRatio () |
Protected Member Functions inherited from SCR_VotingBase | |
| bool | EvaluateParticipation (int voteCount) |
Protected Attributes | |
| ref set< int > | m_aPlayerIDs = new set<int>() |
| int | m_iValue |
Protected Attributes inherited from SCR_VotingBase | |
| 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 |
| float | m_fVoteCooldownTimeStamp = -1 |
| bool | m_bHasInitiatedVotingLocallyOnce |
| int | m_iVoteAuthorId |
| int | m_iLocalValue = DEFAULT_VALUE |
| int | m_iCurrentVoteCount |
| ref array< int > | m_aPlayersVoted_Server = {} |
Additional Inherited Members | |
Static Public Attributes inherited from SCR_VotingBase | |
| 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. | |
Referendum about specific outcome.
Can have target value, e.g., player ID of whoever should be kicked. Multiple votings of the same type can exist at the same type, e.g., KICK player 1 and KICK player 2. The voting succeeds when proportion of votes is larger than given threshold and there was sufficient participation. If time runs out, the voting is invalid.
| override bool SCR_VotingReferendum.AddPlayerVotedServer | ( | int | playerID | ) |
A player has voted to approve (server only)
| [in] | playerID | Id of player who voted |
Implements SCR_VotingBase.
| override bool SCR_VotingReferendum.Evaluate | ( | out EVotingOutcome | outcome | ) |
Evaluate if the voting can end.
| [out] | outcome | Outcome of the vote (used only when returned value is true) |
Implements SCR_VotingBase.
Implemented in SCR_VotingEditorIn, SCR_VotingEditorWithdraw, and SCR_VotingKick.
| override int SCR_VotingReferendum.GetPlayerVote | ( | int | playerID | ) |
|
protected |
| override int SCR_VotingReferendum.GetValue | ( | ) |
Get voting value.
Applicable only if the voting targets specific value, e.g., is referendum about certain outcome.
Implements SCR_VotingBase.
| override int SCR_VotingReferendum.GetWinner | ( | ) |
Get winner of the vote.
Implements SCR_VotingBase.
Implemented in SCR_VotingFactionCommander, and SCR_VotingKick.
| override void SCR_VotingReferendum.InitFromTemplate | ( | SCR_VotingBase | template, |
| int | startingPlayerID, | ||
| int | value, | ||
| float | remainingDuration ) |
Initialise voting from given template.
| [in] | template | Source template |
| [in] | startingPlayerID | id of a player who started the vote |
| [in] | value | Target value |
| [in] | remainingDuration | Remaining time until the voting ends in seconds (-1 to use default) |
Implements SCR_VotingBase.
Implemented in SCR_VotingEditorIn, SCR_VotingGroupLeader, and SCR_VotingKick.
| override bool SCR_VotingReferendum.IsMatching | ( | EVotingType | type, |
| int | value = DEFAULT_VALUE ) |
Check if the voting is matching given params.
| [in] | type | Voting type |
| [in] | value | Voting value |
Implements SCR_VotingBase.
| override void SCR_VotingReferendum.Log | ( | ) |
Implements SCR_VotingBase.
| override bool SCR_VotingReferendum.RemovePlayerVotedServer | ( | int | playerID | ) |
A player has voted to remove or abstain (server only)
| [in] | playerID | Id of player who voted to remove or abstain |
Implements SCR_VotingBase.
| override bool SCR_VotingReferendum.RemoveValue | ( | int | value | ) |
| override bool SCR_VotingReferendum.RemoveVote | ( | int | playerID | ) |
Remove vote of given player.
| [in] | playerID | Player ID |
Implements SCR_VotingBase.
| override void SCR_VotingReferendum.SetVote | ( | int | playerID, |
| int | value = DEFAULT_VALUE ) |
Set vote of given player.
| [in] | playerID | Player ID |
| [in] | value | Cast vote |
Implements SCR_VotingBase.
|
protected |
|
protected |