Beeg fixpack
This commit is contained in:
@@ -16,10 +16,6 @@ public interface IGameRepo : IDisposable
|
||||
|
||||
event Action<string>? AnnounceMessageInInventoryEvent;
|
||||
|
||||
event Action<int>? DoubleExpTimeStart;
|
||||
|
||||
event Action? DoubleExpTimeEnd;
|
||||
|
||||
event Action<IBaseInventoryItem>? RemoveItemFromInventoryEvent;
|
||||
|
||||
event Action? PlayerAttack;
|
||||
@@ -40,10 +36,6 @@ public interface IGameRepo : IDisposable
|
||||
|
||||
IAutoProp<bool> IsPaused { get; }
|
||||
|
||||
public void StartDoubleEXP(TimeSpan lengthOfEffect);
|
||||
|
||||
public void EndDoubleExp();
|
||||
|
||||
public void AnnounceMessageOnMainScreen(string message);
|
||||
|
||||
public void AnnounceMessageInInventory(string message);
|
||||
@@ -63,8 +55,6 @@ public interface IGameRepo : IDisposable
|
||||
public void OnUnequippedItem(IEquipableItem item);
|
||||
|
||||
public void OnEnemyDied(IEnemy enemy);
|
||||
|
||||
public double ExpRate { get; }
|
||||
}
|
||||
|
||||
public class GameRepo : IGameRepo
|
||||
@@ -73,8 +63,6 @@ public class GameRepo : IGameRepo
|
||||
public event Action? CloseInventoryEvent;
|
||||
public event Action<string>? AnnounceMessageOnMainScreenEvent;
|
||||
public event Action<string>? AnnounceMessageInInventoryEvent;
|
||||
public event Action<int>? DoubleExpTimeStart;
|
||||
public event Action? DoubleExpTimeEnd;
|
||||
public event Action<IBaseInventoryItem>? RemoveItemFromInventoryEvent;
|
||||
public event Action? PlayerAttack;
|
||||
public event Action? PlayerAttackedWall;
|
||||
@@ -85,14 +73,11 @@ public class GameRepo : IGameRepo
|
||||
public IAutoProp<bool> IsPaused => _isPaused;
|
||||
private readonly AutoProp<bool> _isPaused;
|
||||
|
||||
public double ExpRate { get; private set; }
|
||||
|
||||
private bool _disposedValue;
|
||||
|
||||
public GameRepo()
|
||||
{
|
||||
_isPaused = new AutoProp<bool>(true);
|
||||
ExpRate = 1;
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
@@ -107,20 +92,6 @@ public class GameRepo : IGameRepo
|
||||
GD.Print("Resume");
|
||||
}
|
||||
|
||||
public void StartDoubleEXP(TimeSpan lengthOfEffect)
|
||||
{
|
||||
AnnounceMessageInInventory("Experience points temporarily doubled.");
|
||||
DoubleExpTimeStart?.Invoke(lengthOfEffect.Seconds);
|
||||
ExpRate *= 2;
|
||||
}
|
||||
|
||||
public void EndDoubleExp()
|
||||
{
|
||||
AnnounceMessageOnMainScreen("Experience points effect wore off.");
|
||||
DoubleExpTimeEnd?.Invoke();
|
||||
ExpRate /= 2;
|
||||
}
|
||||
|
||||
public void AnnounceMessageOnMainScreen(string message)
|
||||
{
|
||||
AnnounceMessageOnMainScreenEvent?.Invoke(message);
|
||||
|
||||
Reference in New Issue
Block a user