using System;
using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
/// 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.
internal class ModGameLoopEvents : ModEventsBase, IGameLoopEvents
{
/*********
** Accessors
*********/
/// Raised after the game is launched, right before the first update tick.
public event EventHandler Launched
{
add => this.EventManager.GameLoop_Launched.Add(value);
remove => this.EventManager.GameLoop_Launched.Remove(value);
}
/// Raised before the game performs its overall update tick (≈60 times per second).
public event EventHandler Updating
{
add => this.EventManager.GameLoop_Updating.Add(value);
remove => this.EventManager.GameLoop_Updating.Remove(value);
}
/// Raised after the game performs its overall update tick (≈60 times per second).
public event EventHandler Updated
{
add => this.EventManager.GameLoop_Updated.Add(value);
remove => this.EventManager.GameLoop_Updated.Remove(value);
}
/*********
** Public methods
*********/
/// Construct an instance.
/// The mod which uses this instance.
/// The underlying event manager.
internal ModGameLoopEvents(IModMetadata mod, EventManager eventManager)
: base(mod, eventManager) { }
}
}