Beispiel #1
0
 internal Enumerator(SerializableDictionaryGameObject dictionary)
 {
     this.dictionary = dictionary;
     version         = dictionary.version;
     index           = 0;
     currentValue    = default(ReplaceResData);
 }
Beispiel #2
0
 internal Enumerator(SerializableDictionaryGameObject dictionary)
 {
     this.dictionary = dictionary;
     version         = dictionary.version;
     index           = 0;
     currentKey      = default(string);
 }
Beispiel #3
0
 public KeyCollection(SerializableDictionaryGameObject dictionary)
 {
     if (dictionary == null)
     {
         throw new ArgumentNullException("dictionary");
     }
     this.dictionary = dictionary;
 }
Beispiel #4
0
 internal Enumerator(SerializableDictionaryGameObject dictionary, int getEnumeratorRetType)
 {
     this.dictionary           = dictionary;
     version                   = dictionary.version;
     index                     = 0;
     this.getEnumeratorRetType = getEnumeratorRetType;
     current                   = new KeyValuePair <string, ReplaceResData>();
 }
Beispiel #5
0
    public void TrimExcess()
    {
        var newDict = new SerializableDictionaryGameObject(Count, true);

        // fast copy
        for (int i = 0; i < count; i++)
        {
            if (entriesHashCode[i] >= 0)
            {
                newDict.Add(entriesKey[i], entriesValue[i]);
            }
        }

        // copy internal field to this
        this.buckets         = newDict.buckets;
        this.count           = newDict.count;
        this.entriesHashCode = newDict.entriesHashCode;
        this.entriesKey      = newDict.entriesKey;
        this.entriesNext     = newDict.entriesNext;
        this.entriesValue    = newDict.entriesValue;
        this.freeCount       = newDict.freeCount;
        this.freeList        = newDict.freeList;
    }