package de.nowchess.bot

object BotController {

  private var bots: Map[String, Bot] = Map.empty

  // Register standard bots
  locally {
    val easyBot = ClassicalBot(BotDifficulty.Easy)
    val mediumBot = ClassicalBot(BotDifficulty.Medium)
    val hardBot = ClassicalBot(BotDifficulty.Hard)
    val expertBot = ClassicalBot(BotDifficulty.Expert)

    bots = Map(
      "easy" -> easyBot,
      "medium" -> mediumBot,
      "hard" -> hardBot,
      "expert" -> expertBot
    )
  }

  /** Get a bot by name. */
  def getBot(name: String): Option[Bot] = bots.get(name.toLowerCase)

  /** List all available bot names. */
  def listBots: List[String] = bots.keys.toList.sorted

}
