mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 15:16:33 -08:00
Add player input routines
This commit is contained in:
@@ -5,11 +5,52 @@ namespace King.Resources;
|
||||
|
||||
internal static class Resource
|
||||
{
|
||||
private static bool _sellLandErrorShown;
|
||||
|
||||
public static Stream Title => GetStream();
|
||||
|
||||
public static string InstructionsPrompt => GetString();
|
||||
public static string InstructionsText(int years) => string.Format(GetString(), years);
|
||||
|
||||
public static string Status(
|
||||
float rallods,
|
||||
float countrymen,
|
||||
float workers,
|
||||
float land,
|
||||
float landValue,
|
||||
float plantingCost)
|
||||
=> string.Format(
|
||||
workers == 0 ? StatusWithWorkers : StatusSansWorkers,
|
||||
rallods,
|
||||
(int)countrymen,
|
||||
(int)workers,
|
||||
(int)land,
|
||||
landValue,
|
||||
plantingCost);
|
||||
|
||||
private static string StatusWithWorkers => GetString();
|
||||
private static string StatusSansWorkers => GetString();
|
||||
|
||||
public static string SellLandPrompt => GetString();
|
||||
public static string SellLandError(float farmLand)
|
||||
{
|
||||
var error = string.Format(GetString(), farmLand, _sellLandErrorShown ? "" : SellLandErrorReason);
|
||||
_sellLandErrorShown = true;
|
||||
return error;
|
||||
}
|
||||
private static string SellLandErrorReason => GetString();
|
||||
|
||||
public static string GiveRallodsPrompt => GetString();
|
||||
public static string GiveRallodsError(float rallods) => string.Format(GetString(), rallods);
|
||||
|
||||
public static string PlantLandPrompt => GetString();
|
||||
public static string PlantLandError1 => GetString();
|
||||
public static string PlantLandError2(float farmLand) => string.Format(GetString(), farmLand);
|
||||
public static string PlantLandError3(float rallods) => string.Format(GetString(), rallods);
|
||||
|
||||
public static string PollutionPrompt => GetString();
|
||||
public static string PollutionError(float rallods) => string.Format(GetString(), rallods);
|
||||
|
||||
public static string SavedYearsPrompt => GetString();
|
||||
public static string SavedYearsError(int years) => string.Format(GetString(), years);
|
||||
public static string SavedTreasuryPrompt => GetString();
|
||||
@@ -17,27 +58,6 @@ internal static class Resource
|
||||
public static string SavedWorkersPrompt => GetString();
|
||||
public static string SavedLandPrompt => GetString();
|
||||
public static string SavedLandError => GetString();
|
||||
|
||||
internal static class Formats
|
||||
{
|
||||
public static string Player => GetString();
|
||||
public static string YouLose => GetString();
|
||||
}
|
||||
|
||||
internal static class Prompts
|
||||
{
|
||||
public static string WantInstructions => GetString();
|
||||
public static string HowManyPlayers => GetString();
|
||||
public static string HowManyRows => GetString();
|
||||
public static string HowManyColumns => GetString();
|
||||
public static string TooManyColumns => GetString();
|
||||
}
|
||||
|
||||
internal static class Strings
|
||||
{
|
||||
public static string TooManyColumns => GetString();
|
||||
public static string TooManyRows => GetString();
|
||||
}
|
||||
|
||||
private static string GetString([CallerMemberName] string? name = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user