Example #1
0
 public void AddGameObject(GameObject newObject)
 {
     if (newObject != null)
     {
         _gameObjects.Add(newObject);
     }
     else
     {
         throw new NullReferenceException();
     }
 }
Example #2
0
 private bool CanCheckCollissionWith(GameObject other)
 {
     return Texture != null && other.Texture != null;
 }
Example #3
0
        public bool Contains(GameObject other)
        {
            if (!CanCheckCollissionWith(other)) return false;

            return GetBounds().Contains(other.GetBounds());
        }
Example #4
0
        public bool CollidesWith(GameObject other)
        {
            if (!CanCheckCollissionWith(other)) return false;

            return GetBounds().Intersects(other.GetBounds());
        }
Example #5
0
 public void RemoveGameObject(GameObject gameObject)
 {
     _gameObjects.Remove(gameObject);
 }