Beispiel #1
0
        public static IPoolObject Get(Type objType, IPoolObjectOwner owner, IEventArgs arg)
        {
            IPoolObject o = Instance[objType].Get(arg);

            SetInfo(o, owner, objType);
            //Log.W(type.ToString() + "Get Idel" + Instance.dic[type].CacheCount + "  worker " + Instance.dic[type].WorkerCount);
            return(o);
        }
Beispiel #2
0
        public static void Clear(IPoolObjectOwner owner, IEventArgs arg, bool ignoreRun = true)
        {
            PoolObjInfo o = Instance.infos.Find((i) => { return(i.owner == owner); });

            if (o == null)
            {
                Log.L("Not Find Same IPoolObject");
            }
            else
            {
                ClearOne(o, arg, ignoreRun);
            }
        }
Beispiel #3
0
        private static void SetInfo(IPoolObject obj, IPoolObjectOwner owner, Type t)
        {
            PoolObjInfo o = Instance.infos.Find((i) => { return(i.content == obj); });

            if (o == null)
            {
                o = Instance.infoCreater.Get();
                Instance.infos.Add(o);
            }
            o.owner   = owner;
            o.type    = t;
            o.content = obj;
        }
Beispiel #4
0
        public static void Set(IPoolObject obj, IPoolObjectOwner owner, IEventArgs arg)
        {
            PoolObjInfo o = Instance.infos.Find((i) => { return(i.content == obj && i.owner == owner); });

            if (o == null)
            {
                Log.L("Not Find Same IPoolObject");
            }
            else
            {
                SetOne(o, arg);
            }
        }
Beispiel #5
0
        public static void Set(IPoolObjectOwner owner, IEventArgs arg)
        {
            List <PoolObjInfo> o = Instance.infos.FindAll((i) => { return(i.owner == owner); });

            if (o == null)
            {
                Log.L("Not Find Same IPoolObject");
            }
            else
            {
                o.ForEach((i) =>
                {
                    SetOne(i, arg);
                });
            }
        }
Beispiel #6
0
        public void Set(Type objType, IPoolObjectOwner owner, IEventArgs arg)
        {
            List <PoolObjInfo> o = infos.FindAll((i) => { return(i.owner == owner && i.type == objType); });

            if (o == null)
            {
                Log.L("Not Find Same IPoolObject");
            }
            else
            {
                o.ForEach((i) =>
                {
                    SetOne(i, arg);
                });
            }
        }
Beispiel #7
0
 public static void Set <T>(T[] objs, IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject
 {
     objs.ForEach((o) => { Set(typeof(T), o, owner, arg); });
 }
Beispiel #8
0
 public static void Set <T>(T t, IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject
 {
     Set(typeof(T), t, owner, arg);
 }
Beispiel #9
0
 public static void Set(Type objType, IPoolObject[] objs, IPoolObjectOwner owner, IEventArgs arg)
 {
     objs.ForEach((o) => { Set(objType, o, owner, arg); });
 }
Beispiel #10
0
 public static T Get <T>(IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject
 {
     return((T)Get(typeof(T), owner, arg));
 }