Ejemplo n.º 1
0
        //==============================================================================
        // Walk the list. For each Pellet, call TestOutOfBounds, passing boundsRectangle.
        // For each node that is out of bounds, set its IsAlive property to false.
        //==============================================================================
        public void KillOutOfBounds()
        {
            Pellet walker = headPointer;

            while (walker != null)
            {
                walker.IsAlive = walker.TestOutOfBounds(boundsRectangle);
                bool b = walker.IsAlive;
                walker = walker.Next;
            }
        }
Ejemplo n.º 2
0
        //==============================================================================
        // Walk the list. For each Pellet, call TestOutOfBounds, passing boundsRectangle.
        // For each node that is out of bounds, set its IsAlive property to false.
        //==============================================================================
        public void KillOutOfBounds()
        {
            Pellet nodeWalker = headPointer;

            while (nodeWalker != null)
            {
                if (nodeWalker.TestOutOfBounds(boundsRectangle))
                {
                    nodeWalker.IsAlive = false; //Kill out of bounds pellet
                }
                nodeWalker = nodeWalker.Next;
            }
        }
Ejemplo n.º 3
0
        //==============================================================================
        // Walk the list. For each Pellet, call TestOutOfBounds, passing boundsRectangle.
        // For each node that is out of bounds, set its IsAlive property to false.
        //==============================================================================
        public void KillOutOfBounds()
        {
            Pellet pelletWalker = headPointer;

            while (pelletWalker != null)
            {
                if (pelletWalker.TestOutOfBounds(boundsRectangle))
                {
                    pelletWalker.IsAlive = false;
                }
                pelletWalker = pelletWalker.Next;
            }
        }
Ejemplo n.º 4
0
        //==============================================================================
        // Walk the list. For each Pellet, call TestOutOfBounds, passing boundsRectangle.
        // For each node that is out of bounds, set its IsAlive property to false.
        //==============================================================================
        public void KillOutOfBounds()
        {
            Pellet current = headPointer;

            while (current != null)
            {
                if (current.TestOutOfBounds(boundsRectangle))
                {
                    current.IsAlive = false;
                }
                current = current.Next;
            }
        }
        //==============================================================================
        // Walk the list. For each Pellet, call TestOutOfBounds, passing boundsRectangle.
        // For each node that is out of bounds, set its IsAlive property to false.
        //==============================================================================
        public void KillOutOfBounds()
        {
            // Assign the pelletWalker to reference the same pellet as headPointer
            Pellet pelletWalker = headPointer;

            while (pelletWalker != null)
            {
                // When pelletWalker goes out of bound, the bool alive property is set to false
                if (pelletWalker.TestOutOfBounds(boundsRectangle) == true)
                {
                    pelletWalker.IsAlive = false;
                }

                // Set next pellet to be the pelletWalker
                pelletWalker = pelletWalker.Next;
            }
        }