bool HasDirectPath(GridDungeonModel gridModel, Cell cellA, Cell cellB) { bool directPath = true; if (cellA.CellType == CellType.Room || cellB.CellType == CellType.Room) { directPath = gridModel.DoorManager.ContainsDoorBetweenCells(cellA.Id, cellB.Id); } else { // Check if we have a fence separating them if they have different heights if (cellA.Bounds.Location.y != cellB.Bounds.Location.y) { directPath = gridModel.ContainsStair(cellA.Id, cellB.Id); } } return directPath; }
bool HasDirectPath(GridDungeonModel gridModel, Cell cellA, Cell cellB) { bool directPath = true; if (cellA.CellType == CellType.Room || cellB.CellType == CellType.Room) { directPath = gridModel.DoorManager.ContainsDoorBetweenCells(cellA.Id, cellB.Id); } else { // Check if we have a fence separating them if they have different heights if (cellA.Bounds.Location.y != cellB.Bounds.Location.y) { directPath = gridModel.ContainsStair(cellA.Id, cellB.Id); } } return(directPath); }