SMAPI/StardewModdingAPI/Events/Player.cs

26 lines
807 B
C#
Raw Normal View History

using StardewValley;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StardewModdingAPI.Events
{
public static class PlayerEvents
{
public static event EventHandler<EventArgsFarmerChanged> FarmerChanged = delegate { };
2016-03-05 03:10:39 +08:00
public static event EventHandler<EventArgsInventory> InventoryChanged = delegate { };
public static void InvokeFarmerChanged(Farmer priorFarmer, Farmer newFarmer)
{
FarmerChanged.Invoke(null, new EventArgsFarmerChanged(priorFarmer, newFarmer));
}
2016-03-05 03:10:39 +08:00
public static void InvokeInventoryChanged(List<Item> inventory)
{
FarmerChanged.Invoke(null, new InventoryChanged(inventory));
}
}
}