예제 #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++;
                }
            }
        }
예제 #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);
        }
예제 #3
0
 public void SetBoundingArea(BoundingArea boundingArea)
 {
     _boundingArea = boundingArea;
 }
예제 #4
0
 public bool Contains(BoundingArea boundingArea)
 {
     return(GetRect().Contains(boundingArea.GetRect()));
 }
예제 #5
0
 public bool Intersects(BoundingArea boundingArea)
 {
     return(GetRect().Intersects(boundingArea.GetRect()));
 }