mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-10 12:14:41 -08:00
Add evaluation of migration and agriculture
This commit is contained in:
1
53_King/csharp/Resources/Emigration.txt
Normal file
1
53_King/csharp/Resources/Emigration.txt
Normal file
@@ -0,0 +1 @@
|
||||
{0} countrymen left the island.
|
||||
2
53_King/csharp/Resources/Harvest.txt
Normal file
2
53_King/csharp/Resources/Harvest.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
you harvested {0} sq. miles of crops.
|
||||
{1}making {2} rallods.
|
||||
1
53_King/csharp/Resources/HarvestReason.txt
Normal file
1
53_King/csharp/Resources/HarvestReason.txt
Normal file
@@ -0,0 +1 @@
|
||||
(Due to increased air and water pollution from foreign industry.)
|
||||
1
53_King/csharp/Resources/Immigration.txt
Normal file
1
53_King/csharp/Resources/Immigration.txt
Normal file
@@ -0,0 +1 @@
|
||||
{0} countrymen came to the island.
|
||||
1
53_King/csharp/Resources/LandPlanted.txt
Normal file
1
53_King/csharp/Resources/LandPlanted.txt
Normal file
@@ -0,0 +1 @@
|
||||
Of {0} sq. miles planted,
|
||||
@@ -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)
|
||||
|
||||
1
53_King/csharp/Resources/WorkerMigration.txt
Normal file
1
53_King/csharp/Resources/WorkerMigration.txt
Normal file
@@ -0,0 +1 @@
|
||||
{0} workers came to the country and
|
||||
Reference in New Issue
Block a user