/// <summary> /// The method checks if given GameObject crashed into a wall /// </summary> /// <param name="movableObject"></param> /// <param name="allWalls"></param> /// <returns>The method returns all GameObjects which crashed into a wall and should call method MoveBack();</returns> public static bool SeeForCollisionWithWalls(MovableObject movableObject, List <Wall> allWalls) { foreach (var wall in allWalls) { if (movableObject.CanCollideWith(wall)) { return(true); } } return(false); }