using System;
using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
/// Events raised when the player data changes.
internal class ModPlayerEvents : ModEventsBase, IPlayerEvents
{
/*********
** Accessors
*********/
/// Raised after items are added or removed to a player's inventory. NOTE: this event is currently only raised for the local player.
public event EventHandler InventoryChanged
{
add => this.EventManager.InventoryChanged.Add(value, this.Mod);
remove => this.EventManager.InventoryChanged.Remove(value);
}
/// Raised after a player skill level changes. This happens as soon as they level up, not when the game notifies the player after their character goes to bed. NOTE: this event is currently only raised for the local player.
public event EventHandler LevelChanged
{
add => this.EventManager.LevelChanged.Add(value, this.Mod);
remove => this.EventManager.LevelChanged.Remove(value);
}
/// Raised after a player warps to a new location. NOTE: this event is currently only raised for the local player.
public event EventHandler Warped
{
add => this.EventManager.Warped.Add(value, this.Mod);
remove => this.EventManager.Warped.Remove(value);
}
/*********
** Public methods
*********/
/// Construct an instance.
/// The mod which uses this instance.
/// The underlying event manager.
internal ModPlayerEvents(IModMetadata mod, EventManager eventManager)
: base(mod, eventManager) { }
}
}