Exemple #1
0
 public virtual ContainerGet Get(double amount) {
   if (amount > Capacity) throw new ArgumentException("Cannot get more than capacity", "amount");
   var get = new ContainerGet(Environment, TriggerPut, amount);
   GetQueue.Enqueue(get);
   TriggerGet();
   return get;
 }
 protected virtual void DoGet(ContainerGet get)
 {
     if (Level >= get.Amount)
     {
         Level -= get.Amount;
         get.Succeed();
     }
 }
Exemple #3
0
 protected virtual void DoGet(ContainerGet get)
 {
     if (Level >= get.Amount)
     {
         GetWaitingTime?.Add(Environment.ToDouble(Environment.Now - get.Time));
         Level -= get.Amount;
         get.Succeed();
     }
 }
        public virtual ContainerGet Get(double amount)
        {
            if (amount > Capacity)
            {
                throw new ArgumentException("Cannot get more than capacity", "amount");
            }
            var get = new ContainerGet(Environment, TriggerPut, amount);

            GetQueue.Enqueue(get);
            TriggerGet();
            return(get);
        }
 protected virtual void DoGet(ContainerGet get)
 {
     if (Level >= get.Amount) {
     Level -= get.Amount;
     get.Succeed();
       }
 }