Esempio n. 1
0
        public void RemoveIfOutsideBounds(BoundingArea boundingArea)
        {
            int i = 0;

            while (i < _spawnedProjectiles.Count)
            {
                if (!boundingArea.Contains(_spawnedProjectiles[i].GetBoundingArea()))
                {
                    _spawnedProjectiles.RemoveAt(i);
                }
                else
                {
                    i++;
                }
            }
        }
Esempio n. 2
0
        public bool RemoveIfHittingBound(BoundingArea boundingArea)
        {
            bool hitBound = false;
            int  i        = 0;

            while (i < _spawnedProjectiles.Count)
            {
                if (_spawnedProjectiles[i].GetBoundingArea().Intersects(boundingArea))
                {
                    _spawnedProjectiles.RemoveAt(i);
                    hitBound = true;
                }
                else
                {
                    i++;
                }
            }
            return(hitBound);
        }
Esempio n. 3
0
 public void SetBoundingArea(BoundingArea boundingArea)
 {
     _boundingArea = boundingArea;
 }
Esempio n. 4
0
 public bool Contains(BoundingArea boundingArea)
 {
     return(GetRect().Contains(boundingArea.GetRect()));
 }
Esempio n. 5
0
 public bool Intersects(BoundingArea boundingArea)
 {
     return(GetRect().Intersects(boundingArea.GetRect()));
 }