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