Move files and folders to new repo format to enable multi-project format
This commit is contained in:
80
Zennysoft.Game.Ma/src/game/GameEventDepot.cs
Normal file
80
Zennysoft.Game.Ma/src/game/GameEventDepot.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
public interface IGameEventDepot : IDisposable
|
||||
{
|
||||
event Action? OverworldEntered;
|
||||
public void OnOverworldEntered();
|
||||
|
||||
event Action? DungeonAThemeAreaEntered;
|
||||
public void OnDungeonAThemeAreaEntered();
|
||||
|
||||
event Action? DungeonBThemeAreaEntered;
|
||||
public void OnDungeonBThemeAreaEntered();
|
||||
|
||||
event Action? DungeonCThemeAreaEntered;
|
||||
public void OnDungeonCThemeAreaEntered();
|
||||
|
||||
event Action? TeleportEntered;
|
||||
public void OnTeleportEntered();
|
||||
|
||||
event Action? MenuScrolled;
|
||||
public void OnMenuScrolled();
|
||||
|
||||
event Action? MenuBackedOut;
|
||||
public void OnMenuBackedOut();
|
||||
|
||||
event Action? InventorySorted;
|
||||
public void OnInventorySorted();
|
||||
|
||||
event Action<ConsumableItemStats>? HealingItemConsumed;
|
||||
public void OnHealingItemConsumed(ConsumableItemStats item);
|
||||
|
||||
event Action<Vector3, EnemyStatResource>? EnemyDefeated;
|
||||
public void OnEnemyDefeated(Vector3 position, EnemyStatResource enemyStatResource);
|
||||
|
||||
event Action<Restorative>? RestorativePickedUp;
|
||||
public void OnRestorativePickedUp(Restorative restorative);
|
||||
}
|
||||
|
||||
public class GameEventDepot : IGameEventDepot
|
||||
{
|
||||
|
||||
public event Action? OverworldEntered;
|
||||
public event Action? DungeonAThemeAreaEntered;
|
||||
public event Action? DungeonBThemeAreaEntered;
|
||||
public event Action? DungeonCThemeAreaEntered;
|
||||
|
||||
public event Action? TeleportEntered;
|
||||
|
||||
public event Action? MenuScrolled;
|
||||
public event Action? MenuBackedOut;
|
||||
public event Action? InventorySorted;
|
||||
public event Action<ConsumableItemStats>? HealingItemConsumed;
|
||||
public event Action<Restorative>? RestorativePickedUp;
|
||||
|
||||
public event Action<Vector3, EnemyStatResource>? EnemyDefeated;
|
||||
|
||||
public void OnOverworldEntered() => OverworldEntered?.Invoke();
|
||||
public void OnDungeonAThemeAreaEntered() => DungeonAThemeAreaEntered?.Invoke();
|
||||
public void OnDungeonBThemeAreaEntered() => DungeonBThemeAreaEntered?.Invoke();
|
||||
public void OnDungeonCThemeAreaEntered() => DungeonCThemeAreaEntered?.Invoke();
|
||||
|
||||
public void OnTeleportEntered() => TeleportEntered?.Invoke();
|
||||
|
||||
public void OnMenuScrolled() => MenuScrolled?.Invoke();
|
||||
public void OnMenuBackedOut() => MenuBackedOut?.Invoke();
|
||||
|
||||
public void OnInventorySorted() => InventorySorted?.Invoke();
|
||||
public void OnHealingItemConsumed(ConsumableItemStats item) => HealingItemConsumed?.Invoke(item);
|
||||
public void OnRestorativePickedUp(Restorative restorative) => RestorativePickedUp?.Invoke(restorative);
|
||||
|
||||
public void OnEnemyDefeated(Vector3 position, EnemyStatResource enemyStatResource) => EnemyDefeated?.Invoke(position, enemyStatResource);
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user