internal bool IsWallBetween(int x, int z, int x2, int z2) { var c1 = GetCell(x, z); var c2 = GetCell(x2, z2); var slot1 = CellSlotExtensions.CellSlotFromDirectionVector(x2 - x, z2 - z); var slot2 = CellSlotExtensions.OppositeWall(slot1); return(c1 != null && !c1.IsSingleWallEmpty(slot1) || c2 != null && !c2.IsSingleWallEmpty(slot2)); }
private void ClearNeighbourWallSlots(int x, int z, CellSlot slot) { for (int i = 0; i < 4; i++) { var wallSlot = CellSlotExtensions.ToWallSlot(i); if (slot.HasFlag(wallSlot)) { var oppositeWallSlot = CellSlotExtensions.RotateWall(wallSlot, 2); var(dx, dz) = wallSlot.ToDirectionVector(); ClearCellSlot(x + dx, z + dz, oppositeWallSlot); } } }