2016-03-05 04:20:58 +08:00
|
|
|
|
using StardewModdingAPI.Inheritance;
|
|
|
|
|
using StardewValley;
|
2016-03-04 22:05:36 +08:00
|
|
|
|
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:14:19 +08:00
|
|
|
|
public static event EventHandler<EventArgsInventoryChanged> InventoryChanged = delegate { };
|
2016-03-05 04:40:46 +08:00
|
|
|
|
public static event EventHandler<EventArgsLevelUp> LeveledUp = delegate { };
|
2016-03-04 22:05:36 +08:00
|
|
|
|
|
|
|
|
|
public static void InvokeFarmerChanged(Farmer priorFarmer, Farmer newFarmer)
|
|
|
|
|
{
|
|
|
|
|
FarmerChanged.Invoke(null, new EventArgsFarmerChanged(priorFarmer, newFarmer));
|
|
|
|
|
}
|
2016-03-05 03:10:39 +08:00
|
|
|
|
|
2016-03-05 04:20:58 +08:00
|
|
|
|
public static void InvokeInventoryChanged(List<Item> inventory, List<ItemStackChange> changedItems)
|
2016-03-05 03:10:39 +08:00
|
|
|
|
{
|
2016-03-05 04:20:58 +08:00
|
|
|
|
InventoryChanged.Invoke(null, new EventArgsInventoryChanged(inventory, changedItems));
|
2016-03-05 03:10:39 +08:00
|
|
|
|
}
|
2016-03-05 04:40:46 +08:00
|
|
|
|
|
|
|
|
|
public static void InvokeLeveledUp(EventArgsLevelUp.LevelType type, int newLevel)
|
|
|
|
|
{
|
|
|
|
|
LeveledUp.Invoke(null, new EventArgsLevelUp(type, newLevel));
|
|
|
|
|
}
|
2016-03-04 22:05:36 +08:00
|
|
|
|
}
|
|
|
|
|
}
|