Add evaluation of migration and agriculture

This commit is contained in:
Andrew Cooper
2023-01-19 07:36:00 +11:00
parent 9d8a4fbc93
commit 051f3eb5d5
11 changed files with 95 additions and 24 deletions

View File

@@ -56,6 +56,18 @@ internal static class Resource
public static string FuneralExpenses(int expenses) => string.Format(GetString(), expenses);
public static string InsufficientReserves => GetString();
public static string WorkerMigration(int newWorkers) => string.Format(GetString(), newWorkers);
public static string Migration(int migration)
=> string.Format(migration < 0 ? Emigration : Immigration, Math.Abs(migration));
public static string Emigration => GetString();
public static string Immigration => GetString();
public static string LandPlanted(float landPlanted)
=> landPlanted > 0 ? string.Format(GetString(), (int)landPlanted) : "";
public static string Harvest(int yield, int income, bool hasIndustry)
=> string.Format(GetString(), yield, HarvestReason(hasIndustry), income);
private static string HarvestReason(bool hasIndustry) => hasIndustry ? GetString() : "";
private static string PollutionEffect(IRandom random) => GetStrings()[random.Next(5)];
private static string EndAlso(IRandom random)