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); }
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); } }
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; }
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); } }
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); }); } }
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); }); } }
public static void Set <T>(T[] objs, IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject { objs.ForEach((o) => { Set(typeof(T), o, owner, arg); }); }
public static void Set <T>(T t, IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject { Set(typeof(T), t, owner, arg); }
public static void Set(Type objType, IPoolObject[] objs, IPoolObjectOwner owner, IEventArgs arg) { objs.ForEach((o) => { Set(objType, o, owner, arg); }); }
public static T Get <T>(IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject { return((T)Get(typeof(T), owner, arg)); }