public int TestPop(int[] elements)
        {
            CustomQueue <int> queue = new CustomQueue <int>(elements);

            queue.Pop();
            queue.Push(1);
            return(queue.Pop());
        }
Beispiel #2
0
        private void InsertRecordIntoSimDictionary(ModelBase o)
        {
            int pos = _mAvailable.Pop();

            _msimdict[pos] = o;
            o["WLE_OMNI_ARRAY_POSTION"] = pos.AsString();
        }
Beispiel #3
0
    void SpawnNext()
    {
        if (monsters.IsEmpty() && Monster.numMonsters == 0)
        {
            IncrementWave();
        }

        else if (!monsters.IsEmpty())
        {
            string monster = monsters.Pop();
            float  seconds;

            if (float.TryParse(monster, out seconds))
            {
                interval = seconds;
                CancelInvoke();
                InvokeRepeating("SpawnNext", 0f, interval);
            }

            else
            {
                GameObject tmp = Instantiate(monsterPrefab, transform.position, Quaternion.identity);
                ModifyMonster(monster, tmp);
            }
        }
    }
        public bool TestGetEnumenator(int[] elements, string expectedResult)
        {
            CustomQueue <int> queue = new CustomQueue <int>(elements);

            queue.Pop();
            queue.Push(1);
            string result = "";

            foreach (var i in queue)
            {
                result += i + " ";
            }
            return(expectedResult.Equals(result));
            //return queue.Aggregate("", (current, i) => current + (i + " "));
        }