GetIntList() public static method

public static GetIntList ( ) : List
return List
Esempio n. 1
0
        /// Returns all indices of added components.
        public int[] GetComponentIndices()
        {
            if (_componentIndicesCache == null)
            {
                var indices = EntitasCache.GetIntList();

                for (int i = 0; i < _components.Length; i++)
                {
                    if (_components[i] != null)
                    {
                        indices.Add(i);
                    }
                }

                _componentIndicesCache = indices.ToArray();

                EntitasCache.PushIntList(indices);
            }

            return(_componentIndicesCache);
        }
Esempio n. 2
0
        static int[] mergeIndices(int[] allOfIndices, int[] anyOfIndices, int[] noneOfIndices)
        {
            var indicesList = EntitasCache.GetIntList();

            if (allOfIndices != null)
            {
                indicesList.AddRange(allOfIndices);
            }
            if (anyOfIndices != null)
            {
                indicesList.AddRange(anyOfIndices);
            }
            if (noneOfIndices != null)
            {
                indicesList.AddRange(noneOfIndices);
            }

            var mergedIndices = distinctIndices(indicesList);

            EntitasCache.PushIntList(indicesList);

            return(mergedIndices);
        }