2018-02-24 05:55:51 +08:00
|
|
|
using System;
|
2018-12-30 18:00:05 +08:00
|
|
|
using EventSystem.Framework;
|
|
|
|
using StardewModdingAPI;
|
2018-02-24 05:55:51 +08:00
|
|
|
|
|
|
|
namespace EventSystem
|
2018-12-30 18:00:05 +08:00
|
|
|
{
|
|
|
|
// TODO: Make Bed/Sleep Event.
|
|
|
|
public class EventSystem : Mod
|
2018-02-24 05:55:51 +08:00
|
|
|
{
|
|
|
|
public static IModHelper ModHelper;
|
|
|
|
public static IMonitor ModMonitor;
|
|
|
|
|
|
|
|
public static EventManager eventManager;
|
2018-12-30 18:00:05 +08:00
|
|
|
|
|
|
|
/// <summary>The mod entry point, called after the mod is first loaded.</summary>
|
|
|
|
/// <param name="helper">Provides simplified APIs for writing mods.</param>
|
2018-02-24 05:55:51 +08:00
|
|
|
public override void Entry(IModHelper helper)
|
|
|
|
{
|
|
|
|
ModHelper = this.Helper;
|
|
|
|
ModMonitor = this.Monitor;
|
2018-12-30 18:00:05 +08:00
|
|
|
StardewModdingAPI.Events.GameEvents.UpdateTick += this.GameEvents_UpdateTick;
|
|
|
|
StardewModdingAPI.Events.SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
|
2018-02-24 05:55:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private void SaveEvents_AfterLoad(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
eventManager = new EventManager();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void GameEvents_UpdateTick(object sender, EventArgs e)
|
|
|
|
{
|
2018-12-30 18:00:05 +08:00
|
|
|
eventManager?.update();
|
2018-02-24 05:55:51 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|