diff --git a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs index 5e838add3..9e7f67ecb 100644 --- a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs +++ b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs @@ -4,7 +4,8 @@ namespace DDD { public static class GameEvents { - public static InteractionEvent Interaction = new InteractionEvent(); + public static InventoryChangedEvent InventoryChangedEvent = new(); + public static InteractionEvent Interaction = new(); } public static class RestaurantEvents { @@ -21,8 +22,5 @@ public class InteractionEvent : IEvent public GameObject Target; } - public class InventoryChangedEvent : IEvent - { - - } + public class InventoryChangedEvent : IEvent { } } diff --git a/Assets/_DDD/_Scripts/GameData/InventoryItemData.cs b/Assets/_DDD/_Scripts/GameState/InventoryItemData.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameData/InventoryItemData.cs rename to Assets/_DDD/_Scripts/GameState/InventoryItemData.cs diff --git a/Assets/_DDD/_Scripts/GameData/InventoryManager.cs b/Assets/_DDD/_Scripts/GameState/InventoryManager.cs similarity index 93% rename from Assets/_DDD/_Scripts/GameData/InventoryManager.cs rename to Assets/_DDD/_Scripts/GameState/InventoryManager.cs index 6f4c83014..dea0b09be 100644 --- a/Assets/_DDD/_Scripts/GameData/InventoryManager.cs +++ b/Assets/_DDD/_Scripts/GameState/InventoryManager.cs @@ -55,7 +55,8 @@ public bool AddItem(string id, int quantity = 1) _inventoryItemDatas[id] = new InventoryItemData(id, quantity); } - EventBus.Broadcast(new InventoryChangedEvent()); + InventoryChangedEvent evt = GameEvents.InventoryChangedEvent; + EventBus.Broadcast(evt); return true; } @@ -81,7 +82,8 @@ public bool RemoveItem(string id, int quantity = 1) _inventoryItemDatas.Remove(id); } - EventBus.Broadcast(new InventoryChangedEvent()); + InventoryChangedEvent evt = GameEvents.InventoryChangedEvent; + EventBus.Broadcast(evt); return true; }