Esempio n. 1
0
        public static int Create()
        {
            int id;

            if (prevID.Count > 0)
            {
                id = prevID.Pop();
            }
            else
            {
                id = lastID++;
            }


            Tags.Add(id);

            return(id);
        }
Esempio n. 2
0
        public static void Create(MonoEntity a)
        {
            int len = storageActor.Length;

            if (lastID >= len)
            {
                Array.Resize(ref storageActor, lastID << 1);
            }

            if (prevID.Count > 0)
            {
                a.entity = prevID.Pop();
                storageActor[a.entity] = a;
            }
            else
            {
                a.entity = lastID;
                storageActor[lastID++] = a;
            }

            Tags.Add(a.entity);
        }