コード例 #1
0
 internal Enumerator(DictionaryULong <TValue> dictionary)
 {
     this.dictionary   = dictionary;
     this.version      = dictionary.version;
     this.index        = 0;
     this.currentValue = default(TValue);
 }
コード例 #2
0
ファイル: ArrayUtils.cs プロジェクト: word-ptr/ecs-submodule
        public static void Copy <T, TCopy>(DictionaryULong <T> fromDic, ref DictionaryULong <T> dic, TCopy copy) where TCopy : IArrayElementCopy <T>
        {
            if (fromDic == null)
            {
                if (dic != null)
                {
                    foreach (var kv in dic)
                    {
                        copy.Recycle(kv.Value);
                    }

                    PoolDictionaryULong <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);
                    }

                    PoolDictionaryULong <T> .Recycle(ref dic);
                }

                dic = PoolDictionaryULong <T> .Spawn(fromDic.Count);
            }

            dic.CopyFrom(fromDic, copy);
        }
コード例 #3
0
ファイル: ArrayUtils.cs プロジェクト: word-ptr/ecs-submodule
        public static void Copy <T>(DictionaryULong <T> fromDic, ref DictionaryULong <T> dic)
        {
            if (fromDic == null)
            {
                if (dic != null)
                {
                    PoolDictionaryULong <T> .Recycle(ref dic);
                }

                dic = null;
                return;
            }

            if (dic == null || fromDic.Count != dic.Count)
            {
                if (dic != null)
                {
                    PoolDictionaryULong <T> .Recycle(ref dic);
                }

                dic = PoolDictionaryULong <T> .Spawn(fromDic.Count);
            }

            dic.CopyFrom(fromDic);
        }
コード例 #4
0
 public KeyCollection(DictionaryULong <TValue> dictionary)
 {
     if (dictionary == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.dictionary);
     }
     this.dictionary = dictionary;
 }
コード例 #5
0
 internal Enumerator(DictionaryULong <TValue> dictionary, int getEnumeratorRetType)
 {
     this.dictionary           = dictionary;
     this.version              = dictionary.version;
     this.index                = 0;
     this.getEnumeratorRetType = getEnumeratorRetType;
     this.current              = new KeyValuePair <TKey, TValue>();
 }
コード例 #6
0
 public static void Recycle(ref DictionaryULong <TValue> dic)
 {
     Pools.current.PoolRecycle(ref dic);
 }