Пример #1
0
        /**
         * Will remove all EnemySubSetNodes from the set
         * @param destroyData
         */
        public void removeAllEnemies(bool destroyData)
        {
            EnemySubSetNode target = firstNode.getNextNode();

            while (target != null)
            {
                EnemySubSetNode nextTarget = target.getNextNode();
                if (target.data != null && destroyData)
                {
                    target.data.removeThis();
                }
                target.removeNode();
                target = nextTarget;
            }
        }
Пример #2
0
        /**
         * Will attempt to find the given BaseEnemy in the set and if found will return the EnemySubSetNode that contains it.
         * Otherwise will return null
         * @param target
         * @return
         */
        public EnemySubSetNode findEnemy(BaseEnemy target)
        {
            EnemySubSetNode retVal = null;

            if (target != null)
            {
                EnemySubSetNode currentNode = firstNode.getNextNode();
                while (currentNode != null && retVal == null)
                {
                    if (currentNode.data == target)
                    {
                        retVal = currentNode;
                    }
                    currentNode = currentNode.getNextNode();
                }
            }
            return(retVal);
        }