public void Recycle(ref DictionaryCopyable <TKey, TValue> value) { if (value != null) { PoolDictionaryCopyable <TKey, TValue> .Recycle(ref value); } }
public static void Copy <TKey, T, TCopy>(DictionaryCopyable <TKey, T> fromDic, ref DictionaryCopyable <TKey, T> dic, TCopy copy) where TCopy : IArrayElementCopy <T> { if (fromDic == null) { if (dic != null) { foreach (var kv in dic) { copy.Recycle(kv.Value); } PoolDictionaryCopyable <TKey, T> .Recycle(ref dic); } dic = null; return; } if (dic == null || fromDic.Count != dic.Count) { if (dic != null) { foreach (var kv in dic) { copy.Recycle(kv.Value); } PoolDictionaryCopyable <TKey, T> .Recycle(ref dic); } dic = PoolDictionaryCopyable <TKey, T> .Spawn(fromDic.Count); } dic.CopyFrom(fromDic, copy); }
public static void Copy <TKey, T>(DictionaryCopyable <TKey, T> fromDic, ref DictionaryCopyable <TKey, T> dic) { if (fromDic == null) { if (dic != null) { PoolDictionaryCopyable <TKey, T> .Recycle(ref dic); } dic = null; return; } if (dic == null || fromDic.Count != dic.Count) { if (dic != null) { PoolDictionaryCopyable <TKey, T> .Recycle(ref dic); } dic = PoolDictionaryCopyable <TKey, T> .Spawn(fromDic.Count); } dic.CopyFrom(fromDic); }
public void Set(DictionaryCopyable <TKey, TValue> value) { this.dataObject.Set(value); }
public DataDictionary(DictionaryCopyable <TKey, TValue> data) { this.dataObject = new DataObject <DictionaryCopyable <TKey, TValue>, DataDictionaryProvider <TKey, TValue> >(data); }
public void Clone(DictionaryCopyable <TKey, TValue> from, ref DictionaryCopyable <TKey, TValue> to) { to = PoolDictionaryCopyable <TKey, TValue> .Spawn(from.Count); ArrayUtils.Copy(from, ref to); }
public static void Recycle(ref DictionaryCopyable <TKey, TValue> dic) { Pools.current.PoolRecycle(ref dic); }
public FiltersCache(World world) { this.world = world; this.hash = PoolDictionaryCopyable <int, HashSetCopyable <Entity> > .Spawn(100); }