Esempio n. 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;
 }
Esempio n. 2
0
 protected virtual void DoGet(ContainerGet get)
 {
     if (Level >= get.Amount)
     {
         Level -= get.Amount;
         get.Succeed();
     }
 }
Esempio n. 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();
     }
 }
Esempio n. 4
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);
        }
Esempio n. 5
0
 protected virtual void DoGet(ContainerGet get)
 {
     if (Level >= get.Amount) {
     Level -= get.Amount;
     get.Succeed();
       }
 }