Fan website of IMMORTAL: Gates of Pyre.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
624 B

namespace Services.Immortal;
public class TimingService : ITimingService
{
private int _timing = 1500;
public void Subscribe(Action? action)
{
OnChange += action;
}
public void Unsubscribe(Action? action)
{
OnChange -= action;
}
public int GetTiming()
{
return _timing;
}
public void SetTiming(int timing)
{
if (_timing != timing)
{
_timing = timing;
NotifyDataChanged();
}
}
private event Action? OnChange;
private void NotifyDataChanged()
{
OnChange?.Invoke();
}
}