feature(BuildCalc) Added reset button, can change micro delay, and can alter timing interval again
This commit is contained in:
@@ -1,31 +1,37 @@
|
||||
namespace Services.Immortal;
|
||||
|
||||
public class TimingService : ITimingService {
|
||||
public class TimingService : ITimingService
|
||||
{
|
||||
private int _timing = 1500;
|
||||
|
||||
private event Action? OnChange;
|
||||
|
||||
public void Subscribe(Action? action) {
|
||||
public void Subscribe(Action? action)
|
||||
{
|
||||
OnChange += action;
|
||||
}
|
||||
|
||||
public void Unsubscribe(Action? action) {
|
||||
public void Unsubscribe(Action? action)
|
||||
{
|
||||
OnChange -= action;
|
||||
}
|
||||
|
||||
public int GetTiming() {
|
||||
public int GetTiming()
|
||||
{
|
||||
return _timing;
|
||||
}
|
||||
|
||||
public void SetTiming(int timing) {
|
||||
if (_timing != timing) {
|
||||
public void SetTiming(int timing)
|
||||
{
|
||||
if (_timing != timing)
|
||||
{
|
||||
_timing = timing;
|
||||
NotifyDataChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void NotifyDataChanged() {
|
||||
private event Action? OnChange;
|
||||
|
||||
private void NotifyDataChanged()
|
||||
{
|
||||
OnChange?.Invoke();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user