Example #1
0
        // TODO delete
        //public void CheckAllEnemies()
        //{
        //    Boolean test = false;
        //    for (Byte index = 0; index < maxEnemySpawn; index++)
        //    {
        //        Enemy enemy = EnemyList[index];
        //        if (EnemyType.Test != enemy.EnemyType)
        //        {
        //            continue;
        //        }

        //        SByte slotID = enemy.SlotID;
        //        if (EnemyDict.ContainsKey((Byte)slotID))
        //        {
        //            EnemyDict.Remove((Byte)slotID);
        //        }

        //        enemy.Reset();

        //        //EnemyCount++;
        //        //if (EnemyCount > EnemyTotal)
        //        //{
        //        //    test = true;
        //        //    enemy.None();
        //        //}
        //        //SpawnOneEnemy(index);
        //    }

        ////	return test;
        //}

        public Boolean CheckThisEnemy(Byte index)
        {
            Boolean check = false;

            Enemy enemy = EnemyList[index];

            if (EnemyType.Idle == enemy.EnemyType)
            {
                return(false);
            }

            SByte slotID = enemy.SlotID;

            if (EnemyDict.ContainsKey((Byte)slotID))
            {
                EnemyDict.Remove((Byte)slotID);
            }

            enemy.Reset();

            // Check this is last enemy!!
            if (EnemySpawn >= EnemyTotal)
            {
                enemy.None();
                check = true;
            }

            return(check);
        }
Example #2
0
        public Boolean CheckThisEnemy(Byte index)
        {
            Boolean check = false;

            Enemy enemy = EnemyList[index];

            if (EnemyType.Idle == enemy.EnemyType)
            {
                return(false);
            }

            SByte testID = enemy.SlotID;

            if (testID >= 0 && testID < Constants.MAX_ENEMYS_SPAWN)
            {
                Byte slotID = (Byte)testID;
                if (EnemyDict.ContainsKey(slotID))
                {
                    EnemyDict.Remove(slotID);
                }
            }

            enemy.Reset();

            // Check this is last enemy!!
            if (EnemySpawn >= EnemyTotal)
            {
                enemy.None();
                check = true;
            }

            return(check);
        }