Move App logic to other projects
This commit is contained in:
46
Zennysoft.Game.Ma.Implementation/App/AppRepo.cs
Normal file
46
Zennysoft.Game.Ma.Implementation/App/AppRepo.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Zennysoft.Game.Abstractions;
|
||||
|
||||
namespace Zennysoft.Game.Ma.Implementation;
|
||||
|
||||
public class AppRepo : IAppRepo
|
||||
{
|
||||
public event Action? SplashScreenSkipped;
|
||||
public event Action? MainMenuEntered;
|
||||
public event Action? GameEntered;
|
||||
public event Action? GameExited;
|
||||
|
||||
private bool _disposedValue;
|
||||
|
||||
public void SkipSplashScreen() => SplashScreenSkipped?.Invoke();
|
||||
|
||||
public void OnMainMenuEntered() => MainMenuEntered?.Invoke();
|
||||
|
||||
public void OnEnterGame() => GameEntered?.Invoke();
|
||||
|
||||
public void OnExitGame() => GameExited?.Invoke();
|
||||
|
||||
public void OnGameOver() => GameExited?.Invoke();
|
||||
|
||||
protected void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposedValue)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
// Dispose managed objects.
|
||||
SplashScreenSkipped = null;
|
||||
MainMenuEntered = null;
|
||||
GameEntered = null;
|
||||
GameExited = null;
|
||||
}
|
||||
|
||||
_disposedValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user