Skip to content

Commit 6b70ba1

Browse files
committed
fix warnings and errors
1 parent 0ec3460 commit 6b70ba1

File tree

1 file changed

+0
-19
lines changed
  • src/main/kotlin/tr/emreone/kotlin_utils/extensions

1 file changed

+0
-19
lines changed

src/main/kotlin/tr/emreone/kotlin_utils/extensions/Grid.kt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ val Iterable<Point>.area: Area get() = areaOrNull ?: error("No points given")
2525
val Iterable<Point>.areaOrNull: Area? get() = boundingArea()
2626
val MapGrid<*>.area: Area get() = areaOrNull ?: error("No points given in Map")
2727
val MapGrid<*>.areaOrNull: Area? get() = keys.boundingArea()
28-
val MutableMapGrid<*>.area: Area get() = areaOrNull ?: error("No points given in Map")
29-
val MutableMapGrid<*>.areaOrNull: Area? get() = keys.boundingArea()
30-
3128

3229
/**
3330
* The last (bottom right) point in this [Grid] or `-1 to -1` for an empty Grid.
@@ -157,22 +154,6 @@ fun <T> Grid<T>.formatted(
157154
}
158155
}
159156

160-
fun <T> MapGrid<T>.formatted(
161-
restrictArea: Area? = null,
162-
filler: Any = ' ',
163-
reverseX: Boolean = false,
164-
reverseY: Boolean = false,
165-
showHeaders: Boolean = true,
166-
transform: (Point, T) -> String = { _, value -> "$value" },
167-
): String {
168-
val area = restrictArea ?: keys.boundingArea() ?: return "empty map, nothing to show"
169-
return area.buildFormatted(reverseX, reverseY, showHeaders) element@{ col, row ->
170-
val point = col to row
171-
val value = getOrElse(point) { return@element "$filler" }
172-
transform(col to row, value)
173-
}
174-
}
175-
176157
fun <T> MapGrid<T>.formatted(
177158
area: Area? = null,
178159
filler: Any = ' ',

0 commit comments

Comments
 (0)