public void RemoveIfOutsideBounds(BoundingArea boundingArea) { int i = 0; while (i < _spawnedProjectiles.Count) { if (!boundingArea.Contains(_spawnedProjectiles[i].GetBoundingArea())) { _spawnedProjectiles.RemoveAt(i); } else { i++; } } }
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); }
public void SetBoundingArea(BoundingArea boundingArea) { _boundingArea = boundingArea; }
public bool Contains(BoundingArea boundingArea) { return(GetRect().Contains(boundingArea.GetRect())); }
public bool Intersects(BoundingArea boundingArea) { return(GetRect().Intersects(boundingArea.GetRect())); }