Class EventManager

java.lang.Object
tk.airshipcraft.commonlib.calendar.impl.EventManager
All Implemented Interfaces:
IEventManager

public class EventManager extends Object implements IEventManager

The EventManager class is responsible for managing and scheduling in-game events in the Minecraft world. It allows for the creation, scheduling, and triggering of events based on in-game dates, providing a dynamic gameplay experience that changes with the calendar.

The AbstractGameEvent abstract class provides a structure for creating different types of in-game events. Subclasses of AbstractGameEvent can define specific behaviors in their trigger method

Since:
2023-12-27
Version:
1.0.0
Author:
notzune
  • Constructor Details

    • EventManager

      public EventManager()
      Initializes a new EventManager. Creates a new empty map to hold scheduled events.
  • Method Details

    • scheduleEvent

      public void scheduleEvent(CustomDate date, AbstractGameEvent event)
      Schedules an event to occur on a specific in-game date.
      Specified by:
      scheduleEvent in interface IEventManager
      Parameters:
      date - The date on which the event should occur.
      event - The event to be scheduled.
    • triggerEvents

      public void triggerEvents(CustomDate currentDate)
      Triggers all events scheduled for the current in-game date.
      Specified by:
      triggerEvents in interface IEventManager
      Parameters:
      currentDate - The current in-game date.