Refactor inventory menu logic
This commit is contained in:
@@ -8,9 +8,7 @@ public interface IGameRepo : IDisposable
|
||||
{
|
||||
event Action? Ended;
|
||||
|
||||
event Action? OpenInventory;
|
||||
|
||||
event Action? CloseInventory;
|
||||
event Action? CloseInventoryEvent;
|
||||
|
||||
event Action<string>? AnnounceMessageOnMainScreenEvent;
|
||||
|
||||
@@ -38,14 +36,15 @@ public interface IGameRepo : IDisposable
|
||||
|
||||
public void RemoveItemFromInventory(IInventoryItem item);
|
||||
|
||||
public void CloseInventory();
|
||||
|
||||
public double ExpRate { get; }
|
||||
}
|
||||
|
||||
public class GameRepo : IGameRepo
|
||||
{
|
||||
public event Action? Ended;
|
||||
public event Action? OpenInventory;
|
||||
public event Action? CloseInventory;
|
||||
public event Action? CloseInventoryEvent;
|
||||
public event Action<string>? AnnounceMessageOnMainScreenEvent;
|
||||
public event Action<string>? AnnounceMessageInInventoryEvent;
|
||||
public event Action<int>? DoubleExpTimeStart;
|
||||
@@ -105,6 +104,11 @@ public class GameRepo : IGameRepo
|
||||
RemoveItemFromInventoryEvent?.Invoke(item);
|
||||
}
|
||||
|
||||
public void CloseInventory()
|
||||
{
|
||||
CloseInventoryEvent?.Invoke();
|
||||
}
|
||||
|
||||
public void OnGameEnded()
|
||||
{
|
||||
Pause();
|
||||
|
||||
Reference in New Issue
Block a user