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;
		}
Exemple #2
0
        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);
        }