This commit is contained in:
2025-03-07 01:52:56 -08:00
parent 65e4af8595
commit e7ef669c29
16 changed files with 15 additions and 41 deletions

View File

@@ -1,6 +1,5 @@
using Chickensoft.Collections;
using Godot;
using System;
namespace Zennysoft.Game.Ma.Implementation;
@@ -11,38 +10,22 @@ public interface IGameRepo : IDisposable
void Resume();
IAutoProp<bool> IsPaused { get; }
void SetPlayerGlobalTransform(Transform3D playerGlobalTransform);
public int MaxItemSize { get; }
public int EXPRate { get; set; }
public int CurrentFloor { get; set; }
}
public class GameRepo : IGameRepo
{
public event Action? Ended;
public IAutoProp<Transform3D> PlayerGlobalTransform => _playerGlobalTransform;
private readonly AutoProp<Transform3D> _playerGlobalTransform;
public IAutoProp<bool> IsPaused => _isPaused;
private readonly AutoProp<bool> _isPaused;
public int MaxItemSize => 20;
public int EXPRate { get; set; } = 1;
private bool _disposedValue;
public int CurrentFloor { get; set; } = 0;
public GameRepo()
{
_isPaused = new AutoProp<bool>(true);
_playerGlobalTransform = new AutoProp<Transform3D>(Transform3D.Identity);
}
public void Pause()
@@ -57,8 +40,6 @@ public class GameRepo : IGameRepo
GD.Print("Resume");
}
public void SetPlayerGlobalTransform(Transform3D playerGlobalTransform) => _playerGlobalTransform.OnNext(playerGlobalTransform);
public void OnGameEnded()
{
Pause();