Encapsulate formulae

This commit is contained in:
Andrew Cooper
2022-04-16 17:00:06 +10:00
parent 6927c5ad14
commit 5fbf0dc37f
3 changed files with 38 additions and 16 deletions

View File

@@ -0,0 +1,9 @@
namespace Chief;
internal static class IReadWriteExtensions
{
internal static bool ReadYes(this IReadWrite io, string format, float value) =>
io.ReadYes(string.Format(format, value));
internal static bool ReadYes(this IReadWrite io, string prompt) =>
io.ReadString(prompt).Equals("Yes", StringComparison.InvariantCultureIgnoreCase);
}