public void AddGameObject(GameObject newObject) { if (newObject != null) { _gameObjects.Add(newObject); } else { throw new NullReferenceException(); } }
private bool CanCheckCollissionWith(GameObject other) { return Texture != null && other.Texture != null; }
public bool Contains(GameObject other) { if (!CanCheckCollissionWith(other)) return false; return GetBounds().Contains(other.GetBounds()); }
public bool CollidesWith(GameObject other) { if (!CanCheckCollissionWith(other)) return false; return GetBounds().Intersects(other.GetBounds()); }
public void RemoveGameObject(GameObject gameObject) { _gameObjects.Remove(gameObject); }