I have this code which I refactored to use a switch but it still looks very clumsy. Now I am looking for a way to simplify it.
public async Task CheckAvailability()
{
switch (Settings.Mode)
{
case Enums.MO.Learn:
if (await IsLearn())
{
await ShowFirstMessageAsync();
return;
}
break;
case Enums.MO.Practice:
if (await IsPractice())
{
await ShowFirstMessageAsync();
return;
}
break;
case Enums.MO.Quiz:
if (await IsQuiz())
{
await ShowFirstMessageAsync();
return;
}
break;
default:
break;
}
await PickCard();
}
Is there anyone that can think of a simpler way to implement this without the need for multiple calls to await ShowFirstMessageAsync?