Challenge: Ring the Bell

object Game {
    private var currentRoom : Room = TownSquare()

    var whileIsTrue = true
    fun play() {
        while (whileIsTrue) {
            print("> Enter your command: ")
            println(GameInput(readLine()).processCommand())
        }
    }

    private class GameInput(arg: String?) {
        private val input = arg ?: ""
        val command = input.split(" ")[0]
        val argument = input.split(" ").getOrElse(1, { "" })

        fun processCommand() = when (command.toLowerCase()){
            "move" -> move(argument)
            "quit", "exit" -> {whileIsTrue = false; "Quitting..."}
            "map" -> printMap()
            "ring" -> ringBell(currentRoom)
            else -> commandNotFound()
        }
  }

  private fun ringBell(currentRoom : Room) : String {
        if (currentRoom == TownSquare()) {
            return "The town square bell is ringing!"
        } else {
            return "Ring what? There is nothing here to ring."
        }
    }
}