[Fix] UI Logic
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace Minesweeper.Core
|
||||
{
|
||||
public sealed class GameStateService : IGameStateService
|
||||
{
|
||||
public event Action<GameState> StateChanged;
|
||||
|
||||
public GameState Current { get; private set; } = GameState.FieldSelection;
|
||||
|
||||
public void SetState(GameState state)
|
||||
{
|
||||
if (Current == state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Current = state;
|
||||
StateChanged?.Invoke(Current);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user