示例#1
0
 public virtual FilterStoreGet Get(Func<object, bool> filter = null) {
   if (filter == null) filter = _ => true;
   var get = new FilterStoreGet(Environment, TriggerPut, filter);
   GetQueue.AddLast(get);
   TriggerGet();
   return get;
 }
示例#2
0
        public virtual FilterStoreGet Get(Func <object, bool> filter = null)
        {
            var get = new FilterStoreGet(Environment, TriggerPut, filter ?? TrueFunc);

            GetQueue.AddLast(get);
            TriggerGet();
            return(get);
        }
示例#3
0
 protected virtual void DoGet(FilterStoreGet get) {
   for (int i = 0; i < Items.Count; i++) {
     var item = Items[i];
     if (!get.Filter(item)) continue;
     Items.RemoveAt(i);
     get.Succeed(item);
     return;
   }
 }
示例#4
0
        public virtual FilterStoreGet Get(Func <object, bool> filter = null)
        {
            if (filter == null)
            {
                filter = _ => true;
            }
            var get = new FilterStoreGet(Environment, TriggerPut, filter);

            GetQueue.AddLast(get);
            TriggerGet();
            return(get);
        }
示例#5
0
 protected virtual void DoGet(FilterStoreGet get)
 {
     for (int i = 0; i < Items.Count; i++)
     {
         var item = Items[i];
         if (!get.Filter(item))
         {
             continue;
         }
         Items.RemoveAt(i);
         get.Succeed(item);
         return;
     }
 }
示例#6
0
 protected virtual void DoGet(FilterStoreGet get)
 {
     for (int i = 0; i < Items.Count; i++)
     {
         var item = Items[i];
         if (!get.Filter(item.Item))
         {
             continue;
         }
         GetWaitingTime?.Add(Environment.ToDouble(Environment.Now - get.Time));
         LeadTime?.Add(Environment.ToDouble(Environment.Now - item.AdmissionDate));
         Items.RemoveAt(i);
         get.Succeed(item.Item);
         return;
     }
 }