-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System.Linq; | ||
|
||
namespace InsightLogParser.Client.Menu; | ||
|
||
internal class CheeseMenu : IMenu | ||
{ | ||
private readonly Spider _spider; | ||
|
||
public CheeseMenu(Spider spider) | ||
{ | ||
_spider = spider; | ||
} | ||
|
||
public IEnumerable<(char? key, string text)> MenuOptions | ||
{ | ||
get | ||
{ | ||
yield return (null, "Cheesing. Press [h] to display this menu again and backspace to back"); | ||
if (_spider.IsOnline()) | ||
{ | ||
yield return ('s', "Open solution to last opened puzzle, if available"); | ||
} | ||
} | ||
} | ||
|
||
public async Task<MenuResult> HandleOptionAsync(char keyChar) | ||
Check warning on line 26 in InsightLogParser.Client/Menu/CheeseMenu.cs GitHub Actions / build
|
||
{ | ||
switch (keyChar) | ||
{ | ||
case 's': | ||
_spider.OpenSolutionScreenshot(); | ||
return MenuResult.Ok; | ||
default: | ||
return MenuResult.NotValidOption; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters