A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Sim + UI: a held gdd-0.3 city gets a turn-report line (R-CITY-010, Refs #1711) (#2506)
Beri93cd2f174cac
diff --git a/changelog.d/1711-held-city-line.md b/changelog.d/1711-held-city-line.mdnew file mode 100644index 000000000..87d35dc60--- /dev/null+++ b/changelog.d/1711-held-city-line.md@@ -0,0 +1,6 @@+### Added++- `gdd-0.3` held cities in the turn report (#1711): each turn an enemy military unit holds a city, the turn report lists+ it in a row of its own, "Cities held by the enemy" ("Tel Aviv: held by the enemy; no job income or project work this+ turn"), and the Why screen has the same line. A retaken city gets no line. `gdd-0.1` is unchanged. The Hebrew lines+ are agent drafts awaiting a native read.diff --git a/docs/rules/mvp.md b/docs/rules/mvp.mdindex 74c2af05b..1bb0cc80b 100644--- a/docs/rules/mvp.md+++ b/docs/rules/mvp.md@@ -116,7 +116,7 @@ The #1696 status comment of 27 October 2026 says, "It does not yet provide the lR-CITY-009: The job default (Q-JOBS-1, owner, 15 October 2026). On each housing step, after the refugees become civilians (R-CITY-004), each city whose default is on sets its employed to `min(job slots, civilians + craftsmen)`, in ascending city id, at no Attention cost. Every city's default is on at the start; an accepted `AssignWorkers` order fixes that city's number and turns its default off for the rest of the game. Each change is a `city` cause on the Why screen ("Town: N groups in work"). A city's record writes `jobs=manual` into the state hash only when its default is off.-R-CITY-010: A city the enemy holds pauses (decision D6, owner, 1 November 2026, "Approve all six (Recommended)", [answers](https://github.com/eyalgolan/statecraft-israel/pull/1668#issuecomment-6553884547); #1711). Under gdd-0.3 only, a city is held in a turn when an enemy military unit (a unit with a `side` other than the player's; a halutz has no side and holds nothing, R-UNIT-001) stands on its settlement hex when steps 5 and 6 run, after step 3: no later step moves an enemy unit, so that is where it stands at the turn's end. An enemy formation that arrives on the hex at step 9 (R-UNIT-009) holds the city from the next turn. That turn a held city pays no R-CITY-002 job income and its R-PROJ-003 projects gain no progress: their records, turns left and carried fraction stay as they were. Its staffed arms workshops pause the same way: no charge and no progress, the cycle kept (R-ARMS-006). The housing step still absorbs refugees and fills default jobs; its people and every id stay, nobody is evacuated, and an objective already awarded stays awarded. A turn in which no enemy unit is on the hex pays and builds as before. Cities have no Food production of their own on main (R-FIELD-002 fields belong to no city), so there is nothing else to pause until #1694 links fields to cities. The gdd-0.3 field fixture pauses a field the same way (R-FIELD-002, #2471): a field not Israeli-held at settlement adds no Food, and its farmer and assignment stay until it is retaken. gdd-0.1 and legacy are unchanged, and gdd-0.1 keeps its R-END-003 defeat. The turn-report line for a held city is still to come.+R-CITY-010: A city the enemy holds pauses (decision D6, owner, 1 November 2026, "Approve all six (Recommended)", [answers](https://github.com/eyalgolan/statecraft-israel/pull/1668#issuecomment-6553884547); #1711). Under gdd-0.3 only, a city is held in a turn when an enemy military unit (a unit with a `side` other than the player's; a halutz has no side and holds nothing, R-UNIT-001) stands on its settlement hex when steps 5 and 6 run, after step 3: no later step moves an enemy unit, so that is where it stands at the turn's end. An enemy formation that arrives on the hex at step 9 (R-UNIT-009) holds the city from the next turn. That turn a held city pays no R-CITY-002 job income and its R-PROJ-003 projects gain no progress: their records, turns left and carried fraction stay as they were. Its staffed arms workshops pause the same way: no charge and no progress, the cycle kept (R-ARMS-006). The housing step still absorbs refugees and fills default jobs; its people and every id stay, nobody is evacuated, and an objective already awarded stays awarded. A turn in which no enemy unit is on the hex pays and builds as before. Cities have no Food production of their own on main (R-FIELD-002 fields belong to no city), so there is nothing else to pause until #1694 links fields to cities. The gdd-0.3 field fixture pauses a field the same way (R-FIELD-002, #2471): a field not Israeli-held at settlement adds no Food, and its farmer and assignment stay until it is retaken. gdd-0.1 and legacy are unchanged, and gdd-0.1 keeps its R-END-003 defeat. Each turn a city is held, step 6 writes one Why line for it ("Town: held by the enemy; no job income or project work this turn", no change of its own), in city id order; the turn-report panel lists those lines in a row of their own, "Cities held by the enemy", after the stocks and the arms workshops and before the enemy's orders (#1711). A retaken city gets no line.R-CITY-005: The cities' employed share (employed over civilians and craftsmen, summed over all cities; 1 with none) is an effect-web source of `morale`, Social cohesion (`work_lifts_cohesion`, source id `employed_share`), read after the turn's housing. The legacy loop has no cities, so there it reads 0 and adds nothing. Housing reaches Social cohesion through the existing `housing` link (`homes_lift_morale`) until Phase 3 makes it the cities' aggregate (Q-NAT-2, decided 15 October 2026). Phase 1's separate cohesion value and its two weights are gone (D-C1, Reading 2).diff --git a/sim/Statecraft.Sim.Tests/NoCityLossDefeatTests.cs b/sim/Statecraft.Sim.Tests/NoCityLossDefeatTests.csindex f0641e2ae..11d3c3c68 100644--- a/sim/Statecraft.Sim.Tests/NoCityLossDefeatTests.cs+++ b/sim/Statecraft.Sim.Tests/NoCityLossDefeatTests.cs@@ -225,4 +225,36 @@ public class NoCityLossDefeatTestsAssert.True(Paid(result, "town_a"));Assert.Equal(2, result.State.CityProjects[10].TurnsLeft);}++ static List<Cause> HeldLines(StepResult result) => result.Why.Where(w => w.Key == CauseKeys.CityHeld).ToList();++ // R-CITY-010 (#1711): the turn report's line for a held city comes from the sim. Each turn the enemy holds Town A, one+ // line names it with no change of its own; Town B, never held, gets none; once retaken, Town A gets none either.+ [Fact]+ public void Gdd03HeldCityGetsOneLineEachTurnUntilRetaken()+ {+ var c = Load(); var s = Simulation.NewGame(c, 1, Mode.Historical); Occupy(s);+ for (int i = 0; i < 2; i++)+ {+ var result = Simulation.Step(c, s, Array.Empty<Command>());+ var line = Assert.Single(HeldLines(result));+ Assert.Equal("town_a", line.Target);+ Assert.Equal(0.0, line.Delta);+ Assert.Equal("Town A: held by the enemy; no job income or project work this turn", line.Message);+ s = result.State;+ }+ s.Units.Remove(1); // retaken+ Assert.Empty(HeldLines(Simulation.Step(c, s, Array.Empty<Command>())));+ }++ // R-CITY-010: gdd-0.1 has no held city, so the same enemy unit gives no line; nor does a halutz under gdd-0.3.+ [Theory]+ [InlineData(SaveGame.GddRuleset, false)]+ [InlineData(SaveGame.Gdd03Ruleset, true)]+ public void OnlyAGdd03HeldCityGetsTheLine(string ruleset, bool halutz)+ {+ var c = Load(ruleset); var s = Simulation.NewGame(c, 1, Mode.Historical);+ if (halutz) s.Units.Add(1, new Unit(1, "halutz", 1, 0)); else Occupy(s);+ Assert.Empty(HeldLines(Simulation.Step(c, s, Array.Empty<Command>())));+ }}diff --git a/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs b/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.csindex 8cbb3e5dc..39da67f7b 100644--- a/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs+++ b/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs@@ -2,7 +2,7 @@ using System.Text.RegularExpressions;namespace Statecraft.Sim.Tests;-/// <summary>#1682's 68 source producers, including rare branches. The pre-key constructor expressions are pinned to+/// <summary>#1682's 68 source producers plus city_held (#1711), 69 in all, including rare branches. The pre-key constructor expressions are pinned to/// c7851de so Message, Target and Delta cannot drift while metadata is added. This is not runtime branch coverage.</summary>public class RemainingCauseKeysTests{@@ -17,6 +17,7 @@ public class RemainingCauseKeysTests{yield return new object[] { "Cities.cs", "WorkersAssigned", "new Cause(\"city\", city, count - x.Employed, FormattableString.Invariant($\"{PlayerText.Settlement(c, city)}: {Groups(count)} in work\")" };yield return new object[] { "Cities.cs", "WagesPaid", "new Cause(\"city\", x.Id, paid, $\"{PlayerText.Settlement(c, x.Id)}: jobs paid {PlayerText.MoneyChange(c, \"treasury\", paid)}\"" };+ yield return new object[] { "Cities.cs", "CityHeld", "new Cause(\"city\", x.Id, 0, $\"{PlayerText.Settlement(c, x.Id)}: held by the enemy; no job income or project work this turn\"" }; // R-CITY-010 (#1711)yield return new object[] { "Cities.cs", "ImmigrantsHoused", "new Cause(\"city\", x.Id, absorbed, FormattableString.Invariant($\"{PlayerText.Settlement(c, x.Id)}: {Groups(absorbed)} of immigrants housed\")" };yield return new object[] { "Cities.cs", "WorkersAssigned", "new Cause(\"city\", x.Id, work - housed.Employed, FormattableString.Invariant($\"{PlayerText.Settlement(c, x.Id)}: {Groups(work)} in work\")" };yield return new object[] { "Cities.cs", "HousingShortage", "new Cause(\"city\", x.Id, over, FormattableString.Invariant($\"{PlayerText.Settlement(c, x.Id)}: {Groups(over)} more than its homes hold\")" };@@ -97,9 +98,9 @@ public class RemainingCauseKeysTests}[Fact]- public void InventoryContainsExactly68ProducerSites()+ public void InventoryContainsExactly69ProducerSites(){- Assert.Equal(68, Producers().Count());+ Assert.Equal(69, Producers().Count());}[Fact]@@ -115,7 +116,7 @@ public class RemainingCauseKeysTestssites++;}}- Assert.Equal(124, sites); // 124 with #2534's enemy attack-order line (Combat.Give marks the order's own cause); 123 with #2471's gdd-0.3 field Food line (R-FIELD-002); 122 with #2527's FoodImported and the conversion's fx_reserves line; 120 with #2457's event Debt line (R-EFX-009); 119 with #1700 slice B's ProjectBuilderFreed; 118 with #1700's builders (R-CITY-011: two ProjectBuilder lines, ProjectWaiting, the build order's job-default line); 114 with #1703's gdd-0.3 housing surcharge and housing cohesion lines; 112 with the arms workshops' five (R-ARMS-005 with its job-default line, R-ARMS-006; #1701); 107 with R-MONEY-004's DollarsConverted (#813); 106 since #2212: EconomySystem.OtherMoney's line (105 since #2199: PayOrBorrow's Paid line)+ Assert.Equal(125, sites); // 125 with #1711's CityHeld (R-CITY-010); 124 with #2534's enemy attack-order line (Combat.Give marks the order's own cause); 123 with #2471's gdd-0.3 field Food line (R-FIELD-002); 122 with #2527's FoodImported and the conversion's fx_reserves line; 120 with #2457's event Debt line (R-EFX-009); 119 with #1700 slice B's ProjectBuilderFreed; 118 with #1700's builders (R-CITY-011: two ProjectBuilder lines, ProjectWaiting, the build order's job-default line); 114 with #1703's gdd-0.3 housing surcharge and housing cohesion lines; 112 with the arms workshops' five (R-ARMS-005 with its job-default line, R-ARMS-006; #1701); 107 with R-MONEY-004's DollarsConverted (#813); 106 since #2212: EconomySystem.OtherMoney's line (105 since #2199: PayOrBorrow's Paid line)}[Fact]diff --git a/sim/Statecraft.Sim/Cause.cs b/sim/Statecraft.Sim/Cause.csindex c5a7af837..e2a869b80 100644--- a/sim/Statecraft.Sim/Cause.cs+++ b/sim/Statecraft.Sim/Cause.cs@@ -245,6 +245,8 @@ namespace Statecraft.Simpublic const string OccupationCountdown = "occupation_countdown";/// <summary>Args: none.</summary>public const string DepopulationSupport = "depopulation_support";+ /// <summary>R-CITY-010 (#1711): Target is a city the enemy holds this turn, so its jobs and projects are paused. Delta 0. No args.</summary>+ public const string CityHeld = "city_held";/// <summary>What a <see cref="Borrowed"/> line borrowed for (EconomySystem.PayOrBorrow's callers, and the deficit), and/// what a <see cref="Paid"/> line paid for.</summary>@@ -278,7 +280,7 @@ namespace Statecraft.SimEventNew, EventChosen, EventDelegated, EventDelegatedPartial, EventAmount, EventStock, EventGrant, EventCity,EventUnlock, EventPolicy, EventSetRung, EventRejoin, MilitaryUpkeep, HousingSurcharge, HousingCohesion,ObjectiveCompleted, PrisonersReturned, SoldiersReturned,- WorkersAssigned, WagesPaid, ImmigrantsHoused, HousingShortage, ImmigrantsWaiting, RecruitsVeteran, CorridorStarted, CorridorCancelled, CorridorCompleted, PioneersVeteran, MapBorrowed, MapBuilt, LandWorkStarted, SiteStarted, SiteCancelled, SiteCompleted, ProjectStarted, ProjectCancelled, ProjectCompleted, ProjectBuilder, ProjectBuilderFreed, ProjectWaiting, ArmsBought, WorkshopWorkers, WorkshopArms, WorkshopPaused, DollarsConverted, DollarsConvertedFx, FoodHarvest, FieldFood, FoodShortage, FoodWithoutImports, FoodImported, PrisonerFood, PrisonerFoodShortage, CraftsmenReturned, CraftsmenReassigned, PioneerReturned, PioneersReassigned, TrainingStarted, TrainingArms, TrainingCancelled, TrainingArmsReturned, ReplacementsStopped, ReplacementsJoined, MilitaryTrained, PioneersTrained, CraftsmenTrained, Appointed, Reshuffle, AppointmentsEnded, ApprovalStability, CoalitionCollapsed, LegislatureConvened, GovernmentTookOffice, CoalitionChanged, EraEnded, AdvisoryPolicyRejected, PolicyRejected, PolicySet, AdvisoryBudgetRejected, BudgetRejected, PlaceCaptured, EnemyRegained, PlaceAnnexed, PlaceWithdrawn, PlaceDeported, DeportEffect, DeportCost, OccupationStarted, PendingBecameRaid, OccupationLostUnit, OccupationCountdown, DepopulationSupport,+ WorkersAssigned, WagesPaid, ImmigrantsHoused, HousingShortage, ImmigrantsWaiting, RecruitsVeteran, CorridorStarted, CorridorCancelled, CorridorCompleted, PioneersVeteran, MapBorrowed, MapBuilt, LandWorkStarted, SiteStarted, SiteCancelled, SiteCompleted, ProjectStarted, ProjectCancelled, ProjectCompleted, ProjectBuilder, ProjectBuilderFreed, ProjectWaiting, ArmsBought, WorkshopWorkers, WorkshopArms, WorkshopPaused, DollarsConverted, DollarsConvertedFx, FoodHarvest, FieldFood, FoodShortage, FoodWithoutImports, FoodImported, PrisonerFood, PrisonerFoodShortage, CraftsmenReturned, CraftsmenReassigned, PioneerReturned, PioneersReassigned, TrainingStarted, TrainingArms, TrainingCancelled, TrainingArmsReturned, ReplacementsStopped, ReplacementsJoined, MilitaryTrained, PioneersTrained, CraftsmenTrained, Appointed, Reshuffle, AppointmentsEnded, ApprovalStability, CoalitionCollapsed, LegislatureConvened, GovernmentTookOffice, CoalitionChanged, EraEnded, AdvisoryPolicyRejected, PolicyRejected, PolicySet, AdvisoryBudgetRejected, BudgetRejected, PlaceCaptured, EnemyRegained, PlaceAnnexed, PlaceWithdrawn, PlaceDeported, DeportEffect, DeportCost, OccupationStarted, PendingBecameRaid, OccupationLostUnit, OccupationCountdown, DepopulationSupport, CityHeld,};/// <summary>A number as an Arg: invariant and round-trip, so the UI rounds exactly the value Message rounded.</summary>diff --git a/sim/Statecraft.Sim/Cities.cs b/sim/Statecraft.Sim/Cities.csindex 2d5e1f57f..bc9888dee 100644--- a/sim/Statecraft.Sim/Cities.cs+++ b/sim/Statecraft.Sim/Cities.cs@@ -106,14 +106,19 @@ namespace Statecraft.Sim/// <summary>R-CITY-002, R-CRAFT-002: each city's employed units earn income_per_job_per_year for the turn's share of a/// year. Craftsmen take the jobs first, and each employed craftsman earns craftsman_income_multiple times that.- /// R-CITY-010: a city the enemy holds earns nothing.</summary>+ /// R-CITY-010: a city the enemy holds earns nothing, and gets one line saying so (#1711), in s.Cities' order.</summary>public static void Produce(Content c, GameState s, MvpRules r, double yearFraction, List<Cause> why){PopulationLedger.RefuseAggregate(s);var held = Held(c, s);foreach (var x in s.Cities.Values){- if (x.Employed == 0 || held.Contains(x.Id)) continue;+ if (held.Contains(x.Id))+ {+ why.Add(new Cause("city", x.Id, 0, $"{PlayerText.Settlement(c, x.Id)}: held by the enemy; no job income or project work this turn", key: CauseKeys.CityHeld));+ continue;+ }+ if (x.Employed == 0) continue;var craftsmen = Math.Min(x.Craftsmen, x.Employed);var paid = ((x.Employed - craftsmen) + craftsmen * r.CraftsmanIncomeMultiple) * r.IncomePerJobPerYear * yearFraction;s.Treasury += paid;diff --git a/unity/Assets/Scripts/UI/CauseText.cs b/unity/Assets/Scripts/UI/CauseText.csindex f6a411f11..9db71d170 100644--- a/unity/Assets/Scripts/UI/CauseText.cs+++ b/unity/Assets/Scripts/UI/CauseText.cs@@ -89,7 +89,7 @@ namespace Statecraft.Game.UI// #1682: these branches use captured ids, values and resident flags, never the live GameState.static readonly HashSet<string> RemainingKeys = new HashSet<string>{- CauseKeys.WorkersAssigned, CauseKeys.WagesPaid, CauseKeys.ImmigrantsHoused, CauseKeys.HousingShortage, CauseKeys.ImmigrantsWaiting, CauseKeys.RecruitsVeteran, CauseKeys.CorridorStarted, CauseKeys.CorridorCancelled, CauseKeys.CorridorCompleted, CauseKeys.PioneersVeteran, CauseKeys.MapBorrowed, CauseKeys.MapBuilt, CauseKeys.LandWorkStarted, CauseKeys.SiteStarted, CauseKeys.SiteCancelled, CauseKeys.SiteCompleted, CauseKeys.ProjectStarted, CauseKeys.ProjectCancelled, CauseKeys.ProjectCompleted, CauseKeys.ProjectBuilder, CauseKeys.ProjectBuilderFreed, CauseKeys.ProjectWaiting, CauseKeys.ArmsBought, CauseKeys.WorkshopWorkers, CauseKeys.WorkshopArms, CauseKeys.WorkshopPaused, CauseKeys.DollarsConverted, CauseKeys.DollarsConvertedFx, CauseKeys.FoodHarvest, CauseKeys.FoodShortage, CauseKeys.FoodWithoutImports, CauseKeys.FoodImported, CauseKeys.PrisonerFood, CauseKeys.PrisonerFoodShortage, CauseKeys.CraftsmenReturned, CauseKeys.CraftsmenReassigned, CauseKeys.PioneerReturned, CauseKeys.PioneersReassigned, CauseKeys.TrainingStarted, CauseKeys.TrainingArms, CauseKeys.TrainingCancelled, CauseKeys.TrainingArmsReturned, CauseKeys.ReplacementsStopped, CauseKeys.ReplacementsJoined, CauseKeys.MilitaryTrained, CauseKeys.PioneersTrained, CauseKeys.CraftsmenTrained, CauseKeys.Appointed, CauseKeys.Reshuffle, CauseKeys.AppointmentsEnded, CauseKeys.ApprovalStability, CauseKeys.CoalitionCollapsed, CauseKeys.LegislatureConvened, CauseKeys.GovernmentTookOffice, CauseKeys.CoalitionChanged, CauseKeys.EraEnded, CauseKeys.AdvisoryPolicyRejected, CauseKeys.PolicyRejected, CauseKeys.PolicySet, CauseKeys.AdvisoryBudgetRejected, CauseKeys.BudgetRejected, CauseKeys.PlaceCaptured, CauseKeys.EnemyRegained, CauseKeys.PlaceAnnexed, CauseKeys.PlaceWithdrawn, CauseKeys.PlaceDeported, CauseKeys.DeportEffect, CauseKeys.DeportCost, CauseKeys.OccupationStarted, CauseKeys.PendingBecameRaid, CauseKeys.OccupationLostUnit, CauseKeys.OccupationCountdown, CauseKeys.DepopulationSupport+ CauseKeys.WorkersAssigned, CauseKeys.WagesPaid, CauseKeys.ImmigrantsHoused, CauseKeys.HousingShortage, CauseKeys.ImmigrantsWaiting, CauseKeys.RecruitsVeteran, CauseKeys.CorridorStarted, CauseKeys.CorridorCancelled, CauseKeys.CorridorCompleted, CauseKeys.PioneersVeteran, CauseKeys.MapBorrowed, CauseKeys.MapBuilt, CauseKeys.LandWorkStarted, CauseKeys.SiteStarted, CauseKeys.SiteCancelled, CauseKeys.SiteCompleted, CauseKeys.ProjectStarted, CauseKeys.ProjectCancelled, CauseKeys.ProjectCompleted, CauseKeys.ProjectBuilder, CauseKeys.ProjectBuilderFreed, CauseKeys.ProjectWaiting, CauseKeys.ArmsBought, CauseKeys.WorkshopWorkers, CauseKeys.WorkshopArms, CauseKeys.WorkshopPaused, CauseKeys.DollarsConverted, CauseKeys.DollarsConvertedFx, CauseKeys.FoodHarvest, CauseKeys.FoodShortage, CauseKeys.FoodWithoutImports, CauseKeys.FoodImported, CauseKeys.PrisonerFood, CauseKeys.PrisonerFoodShortage, CauseKeys.CraftsmenReturned, CauseKeys.CraftsmenReassigned, CauseKeys.PioneerReturned, CauseKeys.PioneersReassigned, CauseKeys.TrainingStarted, CauseKeys.TrainingArms, CauseKeys.TrainingCancelled, CauseKeys.TrainingArmsReturned, CauseKeys.ReplacementsStopped, CauseKeys.ReplacementsJoined, CauseKeys.MilitaryTrained, CauseKeys.PioneersTrained, CauseKeys.CraftsmenTrained, CauseKeys.Appointed, CauseKeys.Reshuffle, CauseKeys.AppointmentsEnded, CauseKeys.ApprovalStability, CauseKeys.CoalitionCollapsed, CauseKeys.LegislatureConvened, CauseKeys.GovernmentTookOffice, CauseKeys.CoalitionChanged, CauseKeys.EraEnded, CauseKeys.AdvisoryPolicyRejected, CauseKeys.PolicyRejected, CauseKeys.PolicySet, CauseKeys.AdvisoryBudgetRejected, CauseKeys.BudgetRejected, CauseKeys.PlaceCaptured, CauseKeys.EnemyRegained, CauseKeys.PlaceAnnexed, CauseKeys.PlaceWithdrawn, CauseKeys.PlaceDeported, CauseKeys.DeportEffect, CauseKeys.DeportCost, CauseKeys.OccupationStarted, CauseKeys.PendingBecameRaid, CauseKeys.OccupationLostUnit, CauseKeys.OccupationCountdown, CauseKeys.DepopulationSupport, CauseKeys.CityHeld};static string Remaining(Cause cause, Content c, UiText text, IReadOnlyDictionary<string, string>? namesHe)@@ -167,6 +167,7 @@ namespace Statecraft.Game.UIcase CauseKeys.WorkshopWorkers: // R-ARMS-005 (#1701)return text.Format(key, Settlement(cause.Target), A(0));case CauseKeys.WorkshopArms: // R-ARMS-006+ case CauseKeys.CityHeld: // R-CITY-010 (#1711)return text.Format(key, Settlement(cause.Target));case CauseKeys.WorkshopPaused: // R-ARMS-006: why.cause.workshop_paused.<Workshops.NoWorker or .DebtCeiling>return text.Format(key + "." + A(0), Settlement(cause.Target));diff --git a/unity/Assets/Scripts/UI/TurnReportPresenter.cs b/unity/Assets/Scripts/UI/TurnReportPresenter.csindex c2a6844dc..bcb72f448 100644--- a/unity/Assets/Scripts/UI/TurnReportPresenter.cs+++ b/unity/Assets/Scripts/UI/TurnReportPresenter.cs@@ -29,6 +29,8 @@ namespace Statecraft.Game.UIpublic const string EnemyRow = "enemy";/// <summary>The row after the stocks that lists the arms workshops' Arms and ceiling pauses this turn (#1701 A1).</summary>public const string WorkshopRow = "workshops";+ /// <summary>The row after the workshops' that lists the cities the enemy holds this turn (R-CITY-010, #1711).</summary>+ public const string HeldRow = "held";/// <summary>The units_1948.yaml rows, which name the enemy's units in that row (GameRoot sets them once the map has read/// them); without a row a unit is named by its id (report.unit).</summary>@@ -111,7 +113,8 @@ namespace Statecraft.Game.UI/// <summary>The report's lines for the session's last turn: each top-bar meter whose shown change is not empty, in/// the bar's order (the meters have different units, so no order by size is given without a rule); then national stocks; under- /// <see cref="WorkshopRow"/>, the arms workshops' lines (#1701); under <see cref="EnemyRow"/>, the enemy's orders (#1293).</summary>+ /// <see cref="WorkshopRow"/>, the arms workshops' lines (#1701); under <see cref="HeldRow"/>, the held cities (#1711); under+ /// <see cref="EnemyRow"/>, the enemy's orders (#1293).</summary>public static IReadOnlyList<Line> Lines(SimBridge bridge, UiText text, IReadOnlyList<UnitEntry>? units = null,IReadOnlyDictionary<string, string>? townNamesHe = null){@@ -130,6 +133,11 @@ namespace Statecraft.Game.UIlines.AddRange(StockLines(bridge, text, units, townNamesHe));var workshops = WorkshopLines(bridge, text, townNamesHe);if (workshops.Count > 0) lines.Add(new Line(WorkshopRow, text["report.workshops"], workshops));+ // R-CITY-010 (#1711): a held city's line changes no number (Delta 0), so HudModel.Causes leaves it out and it has+ // its own row; the sim writes it under gdd-0.3 only, in s.Cities' order.+ var held = bridge.Session.Last?.Why.Where(w => w.Key == CauseKeys.CityHeld)+ .Select(w => CauseText.Line(w, bridge.Content, units ?? Array.Empty<UnitEntry>(), text, townNamesHe)).ToList();+ if (held != null && held.Count > 0) lines.Add(new Line(HeldRow, text["report.held"], held));var enemy = EnemyOrders(bridge, text, units);if (enemy.Count > 0) lines.Add(new Line(EnemyRow, text["report.enemy"], enemy));return lines;diff --git a/unity/Assets/Tests/EditMode/CauseTextTests.cs b/unity/Assets/Tests/EditMode/CauseTextTests.csindex 168e9ffa1..6f3b1c92d 100644--- a/unity/Assets/Tests/EditMode/CauseTextTests.cs+++ b/unity/Assets/Tests/EditMode/CauseTextTests.cs@@ -460,6 +460,7 @@ public class CauseTextTestsnew Cause("draft", "arms", 2000000000, "Bought 2000000000 Arms, cost IL\u00A01.3m", key: CauseKeys.ArmsBought, args: new[] { "1.25" }),new Cause("draft", "town", 2, "Town: arms workshops staffed: 2", key: CauseKeys.WorkshopWorkers, args: new[] { "2" }),new Cause("draft", "town", 1, "Town: an arms workshop made 1 Arms", key: CauseKeys.WorkshopArms),+ new Cause("draft", "town", 0, "Town: held by the enemy; no job income or project work this turn", key: CauseKeys.CityHeld), // #1711new Cause("draft", "town", 0, "Town: an arms workshop has no worker without a job this month", key: CauseKeys.WorkshopPaused, args: new[] { Workshops.NoWorker }),new Cause("draft", "treasury", 1.44, "Converted $4.0m of foreign currency into Money: IL\u00A0+1.4m", key: CauseKeys.DollarsConverted, args: new[] { "4" }),new Cause("draft", "fx_reserves", -4, "Foreign currency converted into Money: $-4.0m", key: CauseKeys.DollarsConvertedFx, args: new[] { "4" }), // #2527diff --git a/unity/Assets/Tests/EditMode/TurnReportTests.cs b/unity/Assets/Tests/EditMode/TurnReportTests.csindex b4a574f51..6bfab568d 100644--- a/unity/Assets/Tests/EditMode/TurnReportTests.cs+++ b/unity/Assets/Tests/EditMode/TurnReportTests.cs@@ -321,6 +321,50 @@ public class TurnReportTestsAssert.IsNull(k.Ui.Root.Q("turn-report-heading-" + TurnReportPresenter.WorkshopRow), "no workshop heading");}+ static Cause Held(string city) => new Cause("city", city, 0, city + ": held by the enemy; no job income or project work this turn", key: CauseKeys.CityHeld);++ /// <summary>R-CITY-010 (#1711): a city the enemy holds changes no number, so its sim line (Delta 0) gets a row of its own+ /// after the stocks and before the enemy's orders, one line a city in the sim's order, named in the player's language.+ /// The real content is gdd-0.1, which holds no city, so the lines are added; that the sim gives them under gdd-0.3 only is+ /// NoCityLossDefeatTests.OnlyAGdd03HeldCityGetsTheLine's. The expected lines are literals in both languages.</summary>+ [Test]+ public void HeldCitiesAreReportedInBothLanguages()+ {+ var namesHe = NamesHe();+ foreach (var hebrew in new[] { false, true })+ {+ using var k = EndTurnWith(hebrew ? He : En, new[] { Held("tel_aviv"), Held("haifa") }, namesHe);+ Assert.AreEqual(hebrew ? "ערים בשליטת האויב" : "Cities held by the enemy",+ k.Ui.Q<Label>("turn-report-heading-" + TurnReportPresenter.HeldRow).text);+ CollectionAssert.AreEqual(hebrew+ ? new[]+ {+ "תל אביב: בשליטת האויב: אין הכנסה מעבודה ואין עבודה על מיזמים בתור הזה",+ "חיפה: בשליטת האויב: אין הכנסה מעבודה ואין עבודה על מיזמים בתור הזה",+ }+ : new[]+ {+ "Tel Aviv: held by the enemy; no job income or project work this turn",+ "Haifa: held by the enemy; no job income or project work this turn",+ },+ Causes(k.Ui, TurnReportPresenter.HeldRow));+ var rows = k.Ui.Q<ScrollView>("turn-report-rows").Children().Select(r => r.name).ToList();+ int held = rows.IndexOf("turn-report-" + TurnReportPresenter.HeldRow);+ Assert.Greater(held, rows.IndexOf("turn-report-arms"), "after the stocks");+ Assert.AreEqual(rows.IndexOf("turn-report-" + TurnReportPresenter.EnemyRow), held + 1, "just before the enemy's orders");+ }+ }++ /// <summary>R-CITY-010 (#1711): a turn with no held city has no held row.</summary>+ [Test]+ public void ATurnWithNoHeldCityGivesNoHeldRow()+ {+ using var k = new Kit(En);+ k.Bridge.EndTurn();+ Assert.IsTrue(k.Report.IsOpen, "the report has its other rows");+ Assert.IsNull(k.Ui.Root.Q("turn-report-" + TurnReportPresenter.HeldRow), "no held row");+ }+/// <summary>#1297: a standing enemy attack (R-ENEMY-003) is reported on every turn it engages, not only on the turn it is/// ordered. The opening turn is set up as a later one: the Arab Liberation Army already attacks Golani's hex, which it keeps/// (no order is given this turn) and which engages in step 2 (R-COMBAT-002).</summary>diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex d28fe181b..fc4f841fb 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -537,6 +537,8 @@ report.workshop_paused_debt: "Workshop in {0} paused: debt ceiling"# "'Workshops in Tel Aviv (6): +6 Arms'; pauses likewise combined with a count."): {0} the city's name, {1} how many.report.workshop_arms_n: "Workshops in {0} ({1}): +{1} Arms"report.workshop_paused_debt_n: "Workshops in {0} ({1}) paused: debt ceiling"+# The held cities' row (R-CITY-010, #1711): one line a city, why.cause.city_held.+report.held: "Cities held by the enemy"# The end screen (#812; D-H4): the sim's end report (EndReport.For, #810), formatted only. {0} the card's title, {1} the# player's date, {2} the historical date; the population's {1} is the date of its CBS anchor and {2} the anchor's count.end.title: "The game has ended"@@ -1178,6 +1180,8 @@ why.cause.pending_became_raid: "{0}: no decision was made before the game ended,why.cause.occupation_lost_unit: "{0}: no Israeli unit holds it any more, so the occupation ended as a raid. It is under enemy control again. {1}"why.cause.occupation_countdown: "{0}: {1} of occupation left" # {1} is "1 turn"/"N turns" (CauseText.Turns, #2530)why.cause.depopulation_support: "{0} {1} (the places depopulated by Deport)"+# R-CITY-010 (#1711), gdd-0.3 only: {0} the city.+why.cause.city_held: "{0}: held by the enemy; no job income or project work this turn"why.cause.work.plow: "plowing"why.cause.work.drain: "draining the swamp"why.cause.work.camp: "a training camp"diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex 366d7768e..ba3e2ee74 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -627,6 +627,8 @@ report.workshop_paused_debt: "סדנת נשק ({0}) בהמתנה: תקרת הח# owner, 3 Nov 2026 (HE batch 3: "Approve all as they are").report.workshop_arms_n: "סדנאות נשק ({0}) ({1}): תוספת נשק: {1}"report.workshop_paused_debt_n: "סדנאות נשק ({0}) ({1}) בהמתנה: תקרת החוב"+# The held cities' row (R-CITY-010, #1711). Agent-drafted Hebrew; native review pending (#564).+report.held: "ערים בשליטת האויב"# The end screen (#812; D-H4): the sim's end report, formatted only. For the native reviewer (#564).# The nine end.* keys below: native review: owner, 3 Nov 2026 (HE batch 3: "Approve all as they are"), except# end.population_history, reworded for #2608 (#2620: the CBS figure is the Jewish population), which waits for the@@ -1423,6 +1425,8 @@ why.cause.pending_became_raid: "{0}: לא התקבלה החלטה עד סוף הwhy.cause.occupation_lost_unit: "{0}: אין עוד יחידה ישראלית המחזיקה במקום, ולכן תקופת ההחזקה הסתיימה כפשיטה. המקום שוב בשליטת האויב. {1}"why.cause.occupation_countdown: "{0}: מוחזק, תורות שנותרו: {1}"why.cause.depopulation_support: "{0}: שינוי {1} (המקומות שהתרוקנו מתושביהם בעקבות גירוש)"+# R-CITY-010 (#1711), gdd-0.3 only: {0} the city; no verb agrees with {0} (HE-15). Agent-drafted Hebrew; native review pending (#564).+why.cause.city_held: "{0}: בשליטת האויב: אין הכנסה מעבודה ואין עבודה על מיזמים בתור הזה"why.cause.work.plow: "חריש"why.cause.work.drain: "ייבוש הביצה"why.cause.work.camp: "מחנה אימונים"