SupaLidlGame/Events/EventBus.cs

70 lines
1.7 KiB
C#
Raw Normal View History

2023-08-01 23:49:48 -07:00
using Godot;
namespace SupaLidlGame.Events;
public partial class EventBus : Node
{
2023-09-03 17:42:32 -07:00
public static EventBus Instance { get; private set; }
2023-08-01 23:49:48 -07:00
[Signal]
public delegate void RequestMoveToAreaEventHandler(RequestAreaArgs args);
2023-08-13 16:49:18 -07:00
2023-08-13 20:11:40 -07:00
[Signal]
public delegate void AreaChangedEventHandler(Scenes.Map map);
2023-08-13 16:49:18 -07:00
[Signal]
public delegate void PlayerDeathEventHandler(HurtArgs args);
[Signal]
public delegate void PlayerHurtEventHandler(HurtArgs args);
2023-09-03 17:42:32 -07:00
[Signal]
public delegate void PlayerHitEventHandler(HitArgs args);
[Signal]
public delegate void PlayerXPChangedEventHandler(double xp);
[Signal]
public delegate void PlayerLevelChangedEventHandler(int level);
2023-12-31 05:59:33 -08:00
[Signal]
public delegate void PlayerInventoryUpdateEventHandler(Items.Inventory inventory);
2023-08-13 16:49:18 -07:00
[Signal]
public delegate void PlayerHealthChangedEventHandler(HealthChangedArgs args);
2024-03-25 23:46:24 -07:00
[Signal]
public delegate void PlayerStunEventHandler();
[Signal]
public delegate void PlayerOpenInventoryEventHandler(Items.Inventory inventory);
[Signal]
public delegate void RegisteredBossEventHandler(Characters.Boss boss);
[Signal]
public delegate void DeregisteredBossEventHandler(Characters.Boss boss);
2023-08-17 00:13:24 -07:00
[Signal]
public delegate void EnterTransitionEventHandler();
[Signal]
public delegate void TransitionFinishedEventHandler();
[Signal]
public delegate void ExitTransitionEventHandler();
[Signal]
public delegate void EnterShopEventHandler(string shopResourcePath);
2023-08-17 00:13:24 -07:00
public override void _Ready()
{
ProcessMode = ProcessModeEnum.Always;
2023-09-03 17:42:32 -07:00
if (Instance is not null)
{
throw new MultipleSingletonsException();
}
Instance = this;
2023-08-17 00:13:24 -07:00
}
2023-08-01 23:49:48 -07:00
}