Ejemplo n.º 1
0
        override public void Remove(uint amount_)
        {
            if (amount_ == 0)
            {
                return;
            }

            var evolution = new Evolution()
            {
                Previous = amount
            };

            if (amount_ >= amount)
            {
                evolution.Removed = amount;
                amount            = 0;
                expiration        = 0;
                scheduler.Stop(ref coroutine);
            }
            else
            {
                evolution.Removed = amount_;
                amount           -= amount_;
            }
            evolution.Current = amount;
            _Changed(evolution);
        }
Ejemplo n.º 2
0
 void RemoveFromGroups(uint amount_)
 {
     amount_ = Math.Min(amount, amount_);
     amount -= amount_;
     while (groups.Count > 0 && amount_ > 0)
     {
         if (groups[0].amount > amount_)
         {
             groups[0].amount -= amount_;
             amount_           = 0;
         }
         else
         {
             amount_ -= groups[0].amount;
             scheduler.Stop(ref groups[0].coroutine);
             groups.RemoveAt(0);
         }
     }
 }