Class EventScheduler
Manages scheduling and execution of game events.
public static class EventScheduler
- Inheritance
-
EventScheduler
- Inherited Members
Fields
Current
List of events currently running.
public static List<Event> Current
Field Value
OnEventStarted
Event handler that is triggered when an event starts.
public static Action<Event> OnEventStarted
Field Value
Past
List of events that have already occurred.
public static List<Event> Past
Field Value
Possible
List of all possible events that can be triggered.
public static List<Event> Possible
Field Value
Methods
AddVote(string)
Adds a player's vote for the current event.
public static void AddVote(string characterName)
Parameters
characterName
stringThe name of the character voting.
EndEvent(Guid)
Ends an event and removes it from the current events list. You MUST use this method to end an event, otherwise it will not be removed from the list and will not retrigger.
public static bool EndEvent(Guid guid)
Parameters
guid
GuidThe unique identifier of the event to end.
Returns
- bool
True if the event was successfully ended, false otherwise.
IsVoting()
Checks if there is currently an active vote.
public static bool IsVoting()
Returns
- bool
True if a vote is in progress, false otherwise.
Register(Event)
Registers a new event in the scheduler.
public static void Register(Event e)
Parameters
e
EventThe event to register.
ScheduleLoop()
Main scheduling loop that checks for and triggers events based on various conditions.
public static IEnumerator ScheduleLoop()
Returns
- IEnumerator
An IEnumerator for Unity's coroutine system.
StartVote(Event)
Initiates a vote for a specific event.
public static void StartVote(Event e)
Parameters
e
EventThe event to start voting for.