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 GameEvents
|
|
|
|
|
{
|
|
|
|
|
public static event EventHandler GameLoaded = delegate { };
|
|
|
|
|
public static event EventHandler Initialize = delegate { };
|
|
|
|
|
public static event EventHandler LoadContent = delegate { };
|
|
|
|
|
public static event EventHandler UpdateTick = delegate { };
|
|
|
|
|
|
|
|
|
|
public static void InvokeGameLoaded()
|
|
|
|
|
{
|
|
|
|
|
GameLoaded.Invoke(null, EventArgs.Empty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void InvokeInitialize()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Initialize.Invoke(null, EventArgs.Empty);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2016-03-05 14:32:04 +08:00
|
|
|
|
Log.Error("An exception occured in XNA Initialize: " + ex.ToString());
|
2016-03-04 22:05:36 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void InvokeLoadContent()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
LoadContent.Invoke(null, EventArgs.Empty);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2016-03-05 14:32:04 +08:00
|
|
|
|
Log.Error("An exception occured in XNA LoadContent: " + ex.ToString());
|
2016-03-04 22:05:36 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void InvokeUpdateTick()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
UpdateTick.Invoke(null, EventArgs.Empty);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2016-03-05 14:32:04 +08:00
|
|
|
|
Log.Error("An exception occured in XNA UpdateTick: " + ex.ToString());
|
2016-03-04 22:05:36 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|