Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 public void Advance(int time)
 {
     OnAdvance?.Invoke(time);
 }