aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/ambientaddons/utils/DungeonFloor.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/com/ambientaddons/utils/DungeonFloor.kt')
-rw-r--r--src/main/kotlin/com/ambientaddons/utils/DungeonFloor.kt12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/kotlin/com/ambientaddons/utils/DungeonFloor.kt b/src/main/kotlin/com/ambientaddons/utils/DungeonFloor.kt
index ab11d7f..e0e44cb 100644
--- a/src/main/kotlin/com/ambientaddons/utils/DungeonFloor.kt
+++ b/src/main/kotlin/com/ambientaddons/utils/DungeonFloor.kt
@@ -2,25 +2,27 @@ package com.ambientaddons.utils
data class DungeonFloor(
val mode: Mode,
- val floor: Int
+ val floor: Int,
+ var enteredBoss: Boolean
) {
override fun toString(): String {
- return when {
+ val floorString = when {
floor == 0 -> "E"
mode == Mode.Normal -> "F$floor"
else -> "M$floor"
}
+ return if (enteredBoss) "$floorString [BOSS]" else floorString
}
companion object {
fun String.toDungeonFloor(): DungeonFloor? {
if (this.isEmpty()) return null
- if (this == "E") return DungeonFloor(Mode.Normal, 0)
+ if (this == "E") return DungeonFloor(Mode.Normal, 0, false)
val floorInt = this.last().digitToIntOrNull() ?: return null
if (floorInt !in 1..7) return null
return when (this.first()) {
- 'F' -> DungeonFloor(Mode.Normal, floorInt)
- 'M' -> DungeonFloor(Mode.Master, floorInt)
+ 'F' -> DungeonFloor(Mode.Normal, floorInt, false)
+ 'M' -> DungeonFloor(Mode.Master, floorInt, false)
else -> null
}
}