Ejemplo n.º 1
0
        private int FindNonDefaultSharedComponentIndex(int typeIndex, int hashCode, void *newData)
        {
            int itemIndex;
            NativeMultiHashMapIterator <int> iter;

            if (!m_HashLookup.TryGetFirstValue(hashCode, out itemIndex, out iter))
            {
                return(-1);
            }

            var infos = SharedComponentInfoPtr;

            do
            {
                var data = m_SharedComponentData[itemIndex];
                if (data != null && infos[itemIndex].ComponentType == typeIndex)
                {
                    if (TypeManager.Equals(data, newData, typeIndex))
                    {
                        return(itemIndex);
                    }
                }
            }while (m_HashLookup.TryGetNextValue(out itemIndex, ref iter));

            return(-1);
        }
Ejemplo n.º 2
0
        public bool MoveNext()
        {
            if (isFirst)
            {
                isFirst = false;
                return(map.TryGetFirstValue(key, out value, out iterator));
            }

            return(map.TryGetNextValue(out value, ref iterator));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Retrieve iterator to the next value for the key.
 /// </summary>
 /// <param name="item">Output value.</param>
 /// <param name="it">Iterator.</param>
 /// <returns>Returns true if next value for the key is found.</returns>
 public bool TryGetNextValue(out TValue item, ref NativeMultiHashMapIterator <TKey> it)
 {
     CheckRead();
     return(m_MultiHashMapData.TryGetNextValue(out item, ref it));
 }