Refactor convertBotDifficultyDropdownToBotDifficulty() ot use switch statement
This commit is contained in:
parent
90d8b52a41
commit
f3b28d532c
@ -98,18 +98,16 @@ export class BotDifficultyHelper
|
|||||||
*/
|
*/
|
||||||
public convertBotDifficultyDropdownToBotDifficulty(dropDownDifficulty: string): string
|
public convertBotDifficultyDropdownToBotDifficulty(dropDownDifficulty: string): string
|
||||||
{
|
{
|
||||||
if (dropDownDifficulty.toLowerCase() === "medium")
|
switch (dropDownDifficulty.toLowerCase())
|
||||||
{
|
{
|
||||||
|
case "medium":
|
||||||
return "normal";
|
return "normal";
|
||||||
}
|
case "random":
|
||||||
|
|
||||||
if (dropDownDifficulty.toLowerCase() === "random")
|
|
||||||
{
|
|
||||||
return this.chooseRandomDifficulty();
|
return this.chooseRandomDifficulty();
|
||||||
}
|
default:
|
||||||
|
|
||||||
return dropDownDifficulty.toLowerCase();
|
return dropDownDifficulty.toLowerCase();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Choose a random difficulty from - easy/normal/hard/impossible
|
* Choose a random difficulty from - easy/normal/hard/impossible
|
||||||
|
Loading…
Reference in New Issue
Block a user