Class Election
Inheritance
System.Object
Election
Implements
ISuffixName
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
public sealed class Election : SimpleProposable, ILinkableParameterized<SimpleEntry.NamingOptions>, ICachesValidity, IDescribable, IRPCAuthChecks, IProposable, IHasID, IReInitializable, IHasReferenceableSerializableID, IHostedObject, INamed, IHasTeleportOption, IHasSerializableID, ILinkableParameterized<bool>, ILinkable, ICustomValidity, IValidity, ISuffixName, ISingleEditingUser, IPlayerUseTracking, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, ISettlementAssociated, IController, IViewController, IHasUniversalID, INotifyPropertyChanged
Constructors
Election()
Declaration
Fields
ElectionChoicesChangedEvent
Executed whenever an election's choice options change.
Declaration
public static ThreadSafeAction<Election> ElectionChoicesChangedEvent
Field Value
ElectionFinishedEvent
Executed whenever an election completes.
Declaration
public static ThreadSafeAction<Election> ElectionFinishedEvent
Field Value
ElectionProvisionsChanged
Executed whenever an election's provisions change.
Declaration
public static ThreadSafeAction<Election> ElectionProvisionsChanged
Field Value
ProvisionsChanged
Declaration
public ThreadSafeAction ProvisionsChanged
Field Value
TwitchVotedEvent
Executed when a Twitch user voted on any election.
Declaration
public static ThreadSafeAction<TwitchVote> TwitchVotedEvent
Field Value
UserVotedEvent
Executed when somebody voted in any election.
Declaration
public static ThreadSafeAction<UserRunoffVote> UserVotedEvent
Field Value
Properties
ActionsOnComplete
The actions we run when the election succeeds.
We dont scan the contents because CanStartForActions is called when an election starts, and that does a full consideration of what
states should be allowed, ensures that referenced drafts are also in the election, etc. (we could move that to be a Valid check in the election and
then allow it to be scanned normally, but we'll leave that for now)
Declaration
public ControllerList<CivicAction> ActionsOnComplete { get; }
Property Value
AllowEarlyEndWithEnoughVotes
Declaration
public bool AllowEarlyEndWithEnoughVotes { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
BooleanElection
Declaration
public bool BooleanElection { get; }
Property Value
Type |
Description |
System.Boolean |
|
BooleanElectionNoMarkedUpName
Declaration
public string BooleanElectionNoMarkedUpName { get; }
Property Value
Type |
Description |
System.String |
|
BooleanElectionYesMarkedUpName
Declaration
public string BooleanElectionYesMarkedUpName { get; }
Property Value
Type |
Description |
System.String |
|
BriefStatus
Declaration
public LocString BriefStatus { get; }
Property Value
Choices
Declaration
public ControllerList<ElectionChoice> Choices { get; set; }
Property Value
Declaration
public ThreadSafeList<ElectionComment> Comments { get; set; }
Property Value
CurrentResults
Declaration
public ElectionResult CurrentResults { get; }
Property Value
CurrentSimpleResults
Declaration
public IEnumerable<SimpleResult> CurrentSimpleResults { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<SimpleResult> |
|
DebugElection
Declaration
public bool DebugElection { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Elapsed
Declaration
public double Elapsed { get; }
Property Value
Type |
Description |
System.Double |
|
ElectionStartedEvent
Executed whenever voting for an election starts.
Declaration
public static ThreadSafeAction<Election> ElectionStartedEvent { get; }
Property Value
EndDateTime
Represents the election ending timestamp as System.DateTime
Declaration
public DateTime EndDateTime { get; }
Property Value
Type |
Description |
System.DateTime |
|
Finished
Declaration
public bool Finished { get; }
Property Value
Type |
Description |
System.Boolean |
|
MaxEndTime
Declaration
public double MaxEndTime { get; }
Property Value
Type |
Description |
System.Double |
|
OnComplete
Declaration
public HandleEvent OnComplete { get; }
Property Value
PollElection
Declaration
public bool PollElection { get; }
Property Value
Type |
Description |
System.Boolean |
|
PositionForWinner
Declaration
public ElectedTitle PositionForWinner { get; set; }
Property Value
PossibleWinners
Declaration
public int PossibleWinners { get; }
Property Value
Type |
Description |
System.Int32 |
|
Process
Declaration
public ElectionProcess Process { get; set; }
Property Value
ProposablesInElection
Declaration
public IEnumerable<IProposable> ProposablesInElection { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<IProposable> |
|
RawTwitchVotes
Declaration
public ThreadSafeDictionary<string, TwitchVote> RawTwitchVotes { get; set; }
Property Value
RequiresHost
Declaration
public override bool RequiresHost { get; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
SimpleResults
Declaration
public IEnumerable<SimpleResult> SimpleResults { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<SimpleResult> |
|
TimeEnded
Declaration
public double TimeEnded { get; set; }
Property Value
Type |
Description |
System.Double |
|
TimeLeft
Declaration
public double TimeLeft { get; }
Property Value
Type |
Description |
System.Double |
|
TimeStarted
Declaration
public double TimeStarted { get; set; }
Property Value
Type |
Description |
System.Double |
|
TotalVotes
Declaration
public int TotalVotes { get; }
Property Value
Type |
Description |
System.Int32 |
|
UserVotes
Declaration
public ThreadSafeDictionary<User, UserRunoffVote> UserVotes { get; set; }
Property Value
Methods
AddChoice(ElectionChoice)
Declaration
public void AddChoice(ElectionChoice candidateChoice)
Parameters
AttachCivicAction(CivicAction)
Declaration
public void AttachCivicAction(CivicAction actionPerformed)
Parameters
CancelDraftElection(Player)
Declaration
public void CancelDraftElection(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
CanJoinElection(User)
Declaration
public Result CanJoinElection(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
CanVote(User)
Check the various things that determine if a user can vote or not.
Declaration
public Result CanVote(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
CheckFinishedAndProcess(Boolean)
Declaration
public void CheckFinishedAndProcess(bool forceUpdate = false)
Parameters
Type |
Name |
Description |
System.Boolean |
forceUpdate |
|
Contains(User)
Declaration
public bool Contains(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
Type |
Description |
System.Boolean |
|
DebugForceFinish()
Declaration
public void DebugForceFinish()
Description()
Declaration
public override LocString Description()
Returns
Overrides
Enter()
Declaration
ForceUpdate()
Declaration
public void ForceUpdate()
FullDescribe()
Declaration
public LocString FullDescribe()
Returns
GetChoiceById(ElectionChoiceID)
Declaration
public ElectionChoice GetChoiceById(ElectionChoiceID id)
Parameters
Returns
GetChoiceByName(String)
Declaration
public ElectionChoice GetChoiceByName(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
GetChoiceByUser(User)
Declaration
public ElectionChoice GetChoiceByUser(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
GetChoiceName(ElectionChoiceID)
Declaration
public LocString GetChoiceName(ElectionChoiceID id)
Parameters
Returns
GetChoiceUser(ElectionChoiceID)
Declaration
public User GetChoiceUser(ElectionChoiceID id)
Parameters
Returns
GetCurrentResults()
Generates the current results if theyre not set.
Declaration
public ElectionResult GetCurrentResults()
Returns
GetFinishedResult()
Return the finished results, or null if theyre not done.
Declaration
public ElectionResult GetFinishedResult()
Returns
GetSpeech(ElectionChoiceID)
Declaration
public string GetSpeech(ElectionChoiceID id)
Parameters
Returns
Type |
Description |
System.String |
|
HasProvisionFor(IProposable)
Declaration
public bool HasProvisionFor(IProposable element)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Initialize()
Declaration
public override void Initialize()
Overrides
OnLinkClicked(TooltipOrigin, TooltipClickContext, User)
Declaration
public override void OnLinkClicked(TooltipOrigin origin, TooltipClickContext clickContext, User user)
Parameters
Overrides
OnPostLoad()
Declaration
RemoveProvisionsWhere(Predicate<CivicAction>)
Declaration
public void RemoveProvisionsWhere(Predicate<CivicAction> predicate)
Parameters
Type |
Name |
Description |
System.Predicate<CivicAction> |
predicate |
|
ShowAllVotes(Player)
Display a large text of all the votes.
Declaration
[RPCAuthMaxProposableState]
public void ShowAllVotes(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Start(Player)
Declaration
public Election Start(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Returns
Start(User, Boolean, Boolean)
Declaration
public Election Start(User user, bool notify = true, bool force = false)
Parameters
Type |
Name |
Description |
User |
user |
|
System.Boolean |
notify |
|
System.Boolean |
force |
|
Returns
TwitchVote(String, String, TwitchVote)
Cast a vote from a twitch user.
Declaration
public Result TwitchVote(string twitchID, string twitchUserName, TwitchVote vote)
Parameters
Type |
Name |
Description |
System.String |
twitchID |
|
System.String |
twitchUserName |
|
TwitchVote |
vote |
|
Returns
Veto(User)
Declaration
public void Veto(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Vote(UserRunoffVote)
Declaration
public Result Vote(UserRunoffVote vote)
Parameters
Returns
Voted(User)
Declaration
public bool Voted(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
Type |
Description |
System.Boolean |
|
Withdraw(User)
Declaration
public void Withdraw(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Explicit Interface Implementations
IProposable.RequiresCivicActionToActivate
Declaration
bool IProposable.RequiresCivicActionToActivate { get; }
Returns
Type |
Description |
System.Boolean |
|
Implements
ISuffixName
System.ComponentModel.INotifyPropertyChanged
Extension Methods