public void IncreaseCounter(double value) { Count = Math.Min(Target, Count + value); if (Math.Abs(Count - Target) < 0.001) // Skill level advance { Level++; Target = CalculateNextTarget(); // Invoke any subscribers to the level advance. OnAdvance?.Invoke(Type); } }
public void Advance(double step, string message = null, object sender = null) { if (State != AsyncProgressState.Running) { return; } Progress += step; Message = message; OnAdvance?.Invoke(step, message); if (Progress >= Total) { State = AsyncProgressState.Completed; OnCompleted?.Invoke(AsyncProgressCompleteStatus.Success, null); } }
public void Advance(int time) { OnAdvance?.Invoke(time); }