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

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

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