Пример #1
0
        public virtual int numEntities()
        {
            TIntSet idSet = new TIntHashSet();

            foreach (TIntObjectMap <Component> componentMap in store.Values)
            {
                idSet.addAll(componentMap.keys());
            }
            return(idSet.size());
        }
Пример #2
0
        /// <summary>
        /// Produces an iterator for iterating over all entities
        /// <p/>
        /// This is not designed to be performant, and in general usage entities should not be iterated over.
        /// </summary>
        /// <returns> An iterator over all entity ids. </returns>
        public virtual TIntIterator entityIdIterator()
        {
            TIntSet idSet = new TIntHashSet();

            foreach (TIntObjectMap <Component> componentMap in store.Values)
            {
                idSet.addAll(componentMap.keys());
            }
            return(idSet.GetEnumerator());
        }