using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
/// Manages access to events raised by SMAPI.
internal class ModEvents : IModEvents
{
/*********
** Accessors
*********/
/// Events related to UI and drawing to the screen.
public IDisplayEvents Display { get; }
/// Events linked to the game's update loop. The update loop runs roughly ≈60 times/second to run game logic like state changes, action handling, etc. These can be useful, but you should consider more semantic events like if possible.
public IGameLoopEvents GameLoop { get; }
/// Events raised when the player provides input using a controller, keyboard, or mouse.
public IInputEvents Input { get; }
/// Events raised when the player data changes.
public IPlayerEvents Player { get; }
/// Events raised when something changes in the world.
public IWorldEvents World { get; }
/// Events serving specialised edge cases that shouldn't be used by most mods.
public ISpecialisedEvents Specialised { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The mod which uses this instance.
/// The underlying event manager.
public ModEvents(IModMetadata mod, EventManager eventManager)
{
this.Display = new ModDisplayEvents(mod, eventManager);
this.GameLoop = new ModGameLoopEvents(mod, eventManager);
this.Input = new ModInputEvents(mod, eventManager);
this.Player = new ModPlayerEvents(mod, eventManager);
this.World = new ModWorldEvents(mod, eventManager);
this.Specialised = new ModSpecialisedEvents(mod, eventManager);
}
}
}