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); } }
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)); } }
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); } } } }
public void AddToNonCollidables(GameObjects.IGameObject gameObject) { currentLevel.AddToNonCollidables(gameObject); }