diff --git a/project/src/helpers/BotDifficultyHelper.ts b/project/src/helpers/BotDifficultyHelper.ts index 4ba1bdbb..3cbde021 100644 --- a/project/src/helpers/BotDifficultyHelper.ts +++ b/project/src/helpers/BotDifficultyHelper.ts @@ -98,17 +98,15 @@ export class BotDifficultyHelper */ public convertBotDifficultyDropdownToBotDifficulty(dropDownDifficulty: string): string { - if (dropDownDifficulty.toLowerCase() === "medium") + switch (dropDownDifficulty.toLowerCase()) { - return "normal"; + case "medium": + return "normal"; + case "random": + return this.chooseRandomDifficulty(); + default: + return dropDownDifficulty.toLowerCase(); } - - if (dropDownDifficulty.toLowerCase() === "random") - { - return this.chooseRandomDifficulty(); - } - - return dropDownDifficulty.toLowerCase(); } /**