Exemplo n.º 1
0
 public bool IsCorrectPosition(GameObjects.IGameObject gameObject, int newX, int newY)
 {
     if (this.gameObjects.Any(r => r.X == newX && r.Y == newY) == true)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Exemplo n.º 2
0
 public bool CanBePlaced(GameObjects.IGameObject gameObject, int newX, int newY)
 {
     if (this.gameObjects.Any(r => r == gameObject) == false)
     {
         //throw new ArgumentException("!!!");
         return(false);
     }
     else
     {
         return(IsCorrectPosition(gameObject, newX, newY));
     }
 }
Exemplo n.º 3
0
 public void AddToNonCollidables(GameObjects.IGameObject gameObject)
 {
     Type[] gameObjectInterfaces = gameObject.GetType().GetInterfaces();
     foreach (Type nextInterface in gameObjectInterfaces)
     {
         foreach (Type dictionaryKey in noncollidableDictionary.Keys)
         {
             if (nextInterface.Equals(dictionaryKey))
             {
                 noncollidableDictionary[dictionaryKey].Add(gameObject);
             }
         }
     }
 }
Exemplo n.º 4
0
 public void AddToNonCollidables(GameObjects.IGameObject gameObject)
 {
     currentLevel.AddToNonCollidables(gameObject);
 }