A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Map: Tal Heuberger's last Collection figures in play (refs #708, #886) (#1321)
Eyal Golan2562853eab6e
diff --git a/changelog.d/708.md b/changelog.d/708.mdnew file mode 100644index 000000000..416000bed--- /dev/null+++ b/changelog.d/708.md@@ -0,0 +1,8 @@+- The last of Tal Heuberger's Collection models are in normal play (#708, #886): the Arab villager beside the Arab+ towns and the villages with flocks, only while the sim has residents there and, at Jaffa, Lod, Ramle and Beersheba,+ up to each town's sourced date (owner ruling); the kibbutz woman at every kibbutz; the pioneer farmer at the moshav+ and the tractors' kibbutzim; the elder immigrant, the child and the immigrant woman beside C01 and C10 at every built+ transit camp, with the Yemenite immigrant during Operation Magic Carpet (July 1949 to September 1950); the builder at+ each city project while it is being built; the 1948 soldier as the third figure of the Yiftach and Negev tokens; and+ #336's second Jerusalem as the city's far-zoom model. All stream after the first frame. C01 and C10 now also stand at+ the transit camps the GDD loop builds.diff --git a/docs/units.md b/docs/units.mdindex 88748f19b..380eb2cf3 100644--- a/docs/units.md+++ b/docs/units.md@@ -257,8 +257,9 @@ own root rotation kept (the FBX axis turn, -90 degrees about X), so the camera's|---|---|---|---|| C04 sabra pioneer | an Israeli rifleman in the bush hat (the uniform default's first figure; the showcase trio's first) | #507's pairing | always || C06 young recruit | an Israeli rifleman in the Mk II steel helmet (every token's second figure) | #507's pairing | always |-| C07 veteran fighter | an Israeli rifleman in the knitted stocking cap: the Negev Brigade's first and third, the showcase's third | the Negev headgear photographs (Sources) | always |-| C05 pioneer veteran | the third figure of every Israeli brigade with the uniform default, except Harel | a presentation choice: the default's third figure is not sourced | always |+| C07 veteran fighter | an Israeli rifleman in the knitted stocking cap: the Negev Brigade's first, the showcase's third | the Negev headgear photographs (Sources) | always |+| C05 pioneer veteran | the third figure of every Israeli brigade with the uniform default, except Harel and Yiftach | a presentation choice: the default's third figure is not sourced | always |+| #336's 1948 soldier | the third figure of Yiftach and Negev, the Palmach brigades other than Harel: a rifleman in khaki in the Palmach's knitted stocking cap, so Negev's token shows C07, C06 and him and keeps its sourced caps | owner, 21 October 2026 (#708, through the coordinator): "a third figure on some brigade unit tokens, next to C06 and C07"; the rows' numbers (11th and 12th Brigade (Palmach)) | always || C12F Palmach scout | Harel's third figure, at Sha'ar HaGai on the convoy road | Harel's row (a Palmach brigade escorting the convoys, Izkor); en.wiki Netiva Ben-Yehuda (a Palmach woman's duties included "escorting convoys") | always || C08 Arab Legion | the Arab Legion's three figures | the row; owner, #756 (Tal Heuberger's models approved) | the row's windows || C09 irregular | the Arab Liberation Army's three figures | en.wiki Arab Liberation Army: "an irregular army" of volunteers | the row's windows |@@ -275,8 +276,8 @@ own root rotation kept (the FBX axis turn, -90 degrees about X), so the camera's45 km), each figure whose model has an idle clip (`CollectionCatalog.Animated`) shows its skinned near model playing theclip, as tall as its far model and under the same holder (`UnitFigureDetail`). The near models are asked for only once acamera first comes close; until one arrives, and for good if it is missing, the far mesh stays. C05 has no idle clip- (walk and run only) and keeps his still far model (owner, 18 October 2026, #665: "Keep its still model"). The vehicles- stay far.+ (walk and run only) and keeps his still far model (owner, 18 October 2026, #665: "Keep its still model"); #336's soldier+ has no rig and keeps his still far model too. The vehicles stay far.- **Fail open:** an Israeli figure keeps its code-built mesh until its model arrives, and for good if the bundle ismissing or damaged; a vehicle and an Arab force's token are not drawn until their model arrives.- Tests: `UnitFiguresTests` (every one of the nine is placed on some day of the war; the table; the swap; arms down;diff --git a/unity/Assets/Scripts/Map/Collection/CivilianPeople.cs b/unity/Assets/Scripts/Map/Collection/CivilianPeople.csindex ec2cbb90b..d601299fb 100644--- a/unity/Assets/Scripts/Map/Collection/CivilianPeople.cs+++ b/unity/Assets/Scripts/Map/Collection/CivilianPeople.cs@@ -14,8 +14,17 @@ namespace Statecraft.Game.Map.Collection/// camps (issue #666 and #663's owner ruling that every delivered model is used). They are period-generic ambience,/// never units and never simulation state. C02, C03 and C13 stand at the settled places; C01 and C10 stand at a transit/// camp from the day it is placed. The Arab towns get none of this set: #666 maps it to the towns, kibbutzim, moshavim and- /// camps, and the Collection's Arab villager figure (#708, waiting on its licence line) is the one made for them. Which- /// figures stand at the Arab towns until then is an owner question on the pull request.+ /// camps, and the Collection's Arab villager figure (#708) is the one made for them.+ ///+ /// Tal Heuberger's figures offered in #336 (#708, #886; owner, #336: "we must make sure all of his models are in and fully+ /// used") join them, each where its role is: the Arab villager at the Arab towns and at the villages whose sheep and+ /// donkeys RuralLife draws, only while the sim has their residents there (<see cref="Inhabited"/>) and, at four towns, up+ /// to the sourced date the owner ruled (<see cref="VillagerUntil"/>); the kibbutz woman at+ /// every kibbutz; the pioneer farmer at the moshavim and at the kibbutzim whose tractors RuralLife draws; the elder+ /// immigrant, the child and the immigrant woman beside C01 and C10 at each transit camp, with the Yemenite immigrant+ /// while Operation Magic Carpet's airlift ran (<see cref="YemeniteFrom"/>); and the builder at each of the player's city+ /// projects while it is being built. They come after the C-series groups, the undated ones first, so no new figure+ /// moves a figure that was already standing.////// Far static meshes stream after the first frame through <see cref="CollectionStream"/>. Near skinned meshes and their/// idle clips are not even requested until a camera enters close zoom. A missing bundle or prefab fails open: the affected@@ -28,8 +37,24 @@ namespace Statecraft.Game.Map.Collectionpublic const string ArrivingMan = "figure-c01-arriving-man-v2", Townsman = "figure-c02-townsman-v2",Craftsman = "figure-c03-smith-carpenter-v2", Woman = "figure-c10-woman-blue-dress-v2", Nurse = "figure-c13-nurse-v2";+ public const string ArabVillager = "figure-arab-villager-v1", Builder = "figure-builder-1950-v1",+ ElderImmigrant = "figure-elder-immigrant-v1", ImmigrantChild = "figure-immigrant-child-v1",+ ImmigrantWoman = "figure-immigrant-woman-v1", KibbutzWoman = "figure-kibbutz-woman-v1",+ YemeniteImmigrant = "figure-yemenite-immigrant-v1", PioneerFarmer = "figure-pioneer-farmer-v1-tpose";+public static readonly string[] SettledModels = { Townsman, Craftsman, Nurse };public static readonly string[] CampModels = { ArrivingMan, Woman };+ /// <summary>The immigrants who stand beside C01 and C10 at a transit camp; the Yemenite immigrant joins them in his window.</summary>+ public static readonly string[] ImmigrantModels = { ElderImmigrant, ImmigrantChild, ImmigrantWoman };++ /// <summary>Every model this layer places (a test aid for the catalog's "every model is used" check).</summary>+ public static IEnumerable<string> Models => SettledModels.Concat(CampModels).Concat(ImmigrantModels)+ .Concat(new[] { YemeniteImmigrant, ArabVillager, KibbutzWoman, PioneerFarmer, Builder });++ /// <summary>The Yemenite immigrant stands at the transit camps only while Operation Magic Carpet flew Yemenite Jews in:+ /// the same sourced window as the C-54 at Lod (SeaAirCollection: the main wave from July 1949, the last two aircraft+ /// reaching Lydda on 24 September 1950).</summary>+ public static readonly DateTime YemeniteFrom = SeaAirCollection.C54From, YemeniteTo = SeaAirCollection.C54To;public static readonly string[] SettledTypes = { "city", "town", "kibbutz", "moshav" };public const int SettledGroupSize = 3; // design value: one small, legible group at a permanent settlement@@ -38,6 +63,11 @@ namespace Statecraft.Game.Map.Collection// beside the 204 m locomotive car. Only the unit pieces keep their symbolic size (UnitShowcase.FigureScale).public const float FigureScale = SettlementKits.ModelScale;public const float FigureHeightM = UnitBadge.FigureHeightM * FigureScale;+ /// <summary>Design value (#708): the immigrant child is a boy of about ten, 1.35 m against the 1.78 m man, so he is+ /// drawn shorter than the adults beside him rather than at a man's height.</summary>+ public const float ChildHeightM = 1.35f * FigureScale;+ /// <summary>The height a figure of <paramref name="model"/> is drawn at (m).</summary>+ public static float HeightOf(string model) => model == ImmigrantChild ? ChildHeightM : FigureHeightM;// Design values (#666), kept in proportion to the figure: 1,200 m and 500 m beside a man drawn at the units' scale.public const float FigureSpacingM = 1200f * FigureScale / UnitShowcase.FigureScale; // separates silhouettes without reading as a crowdpublic const float FigureClearanceM = 500f * FigureScale / UnitShowcase.FigureScale; // conservative half-width/clearance for one figure@@ -69,8 +99,13 @@ namespace Statecraft.Game.Map.Collection/// <summary>Builds the deterministic presentation plan. Every group is outside its settlement or camp footprint,/// which also keeps it clear of the name pill anchored there, and clear of route corridors, water, unit tokens and/// all earlier groups. Settlement and placement order are their stable source-file/state order.</summary>- public static List<Want> Wants(MapScene map, DateTime date, IEnumerable<Placement> placements, Content content)+ public static List<Want> Wants(MapScene map, DateTime date, IEnumerable<Placement> placements, Content content,+ IReadOnlyDictionary<string, SettlementControl>? control = null, IEnumerable<CityProject>? projects = null){+ var projectList = (projects ?? Enumerable.Empty<CityProject>()).ToList();+ // The camps the player has built: the legacy loop's placements and, in the GDD loop, the built transit-camp+ // projects, as the placement layer draws them (#1123).+ var camps = PlacementLayer.Drawn(placements, projectList).Where(p => p.Action == MapActions.TransitCamp).ToList();var wants = new List<Want>();if (map == null || map.Terrain == null || map.Hexes == null) return wants;var ground = PlacementLayer.CampGround(map);@@ -88,19 +123,105 @@ namespace Statecraft.Game.Map.CollectionAddGroup(settlement.Id, new Vector2(world.x, world.z), radius, SettledModels, date, ground, reserved, taken, wants);}- foreach (var placement in placements)+ // #336's figures at the settled places (#708, #886), each alone beside the place, undated.+ var rural = RuralLife.Wants(map);+ foreach (var settlement in map.Settlements)+ if (settlement.Type == "arab_town" && VillagerAt(control, settlement.Id, date))+ AddGroup(settlement.Id + ":villager", Anchor(settlement), Radius(settlement), new[] { ArabVillager }, date, ground, reserved, taken, wants);+ foreach (var village in Served(rural, RuralLife.Sheep, RuralLife.Donkey))+ if (VillagerAt(control, village.Key, date))+ AddGroup(village.Key + ":villager", village.Anchor, village.AnchorRadius, new[] { ArabVillager }, date, ground, reserved, taken, wants);+ foreach (var settlement in map.Settlements.Where(x => x.Type == "kibbutz"))+ AddGroup(settlement.Id + ":kibbutz-woman", Anchor(settlement), Radius(settlement), new[] { KibbutzWoman }, date, ground, reserved, taken, wants);+ foreach (var settlement in map.Settlements.Where(x => x.Type == "moshav"))+ AddGroup(settlement.Id + ":farmer", Anchor(settlement), Radius(settlement), new[] { PioneerFarmer }, date, ground, reserved, taken, wants);+ foreach (var field in Served(rural, RuralLife.Tractor))+ AddGroup(field.Key + ":farmer", field.Anchor, field.AnchorRadius, new[] { PioneerFarmer }, date, ground, reserved, taken, wants);++ float hexM = map.Hexes.hex_size_km * 1000f;+ foreach (var placement in camps){- if (placement.Action != MapActions.TransitCamp || date < placement.Date) continue;+ if (date < placement.Date) continue;var hex = content.HexAt(placement.Q, placement.R);if (hex == null) continue;var world = map.Frame.ToWorld(hex.Lon, hex.Lat, 0f);string key = $"{placement.Action}_{placement.Q}_{placement.R}";// Reserve the whole hex around the later-built ma'abara. Its seeded kit may move inside the hex while it// searches for room; the people therefore stand just outside it rather than assuming an unsourced camp plan.- AddGroup(key, new Vector2(world.x, world.z), map.Hexes.hex_size_km * 1000f, CampModels, placement.Date,+ AddGroup(key, new Vector2(world.x, world.z), hexM, CampModels, placement.Date,+ ground, reserved, taken, wants);+ var immigrants = date >= YemeniteFrom && date <= YemeniteTo ? ImmigrantModels.Append(YemeniteImmigrant).ToArray() : ImmigrantModels;+ AddGroup(key + ":immigrants", new Vector2(world.x, world.z), hexM, immigrants, placement.Date,+ ground, reserved, taken, wants);+ }++ // The builder at each of the player's city projects (housing, industry, a transit camp) while it is being built.+ foreach (var project in projectList)+ {+ if (project.BuiltOn != null) continue;+ var hex = content.HexAt(project.Q, project.R);+ if (hex == null) continue;+ var world = map.Frame.ToWorld(hex.Lon, hex.Lat, 0f);+ AddGroup($"project_{project.Id}:builder", new Vector2(world.x, world.z), hexM, new[] { Builder }, date,ground, reserved, taken, wants);}return wants;++ Vector2 Anchor(Settlement settlement)+ {+ var world = map.Frame.ToWorld(settlement.Lon, settlement.Lat, 0f);+ return new Vector2(world.x, world.z);+ }+ float Radius(Settlement settlement) => radii.TryGetValue(settlement.Id, out var kitRadius)+ ? kitRadius : 0.5f * SettlementPlacer.MarkerHeightM(settlement.Type);+ }++ /// <summary>The last day the villager stands at four Arab towns: the owner, 21 October 2026, on #708+ /// (issuecomment-6323524970), "hide each town's villager after its sourced date", the dates taken only from the+ /// sources of the owner-approved #793 packet of 19 October 2026 (issuecomment-6267660409). Each is the date that source+ /// gives for the town's capture, quoted below; no other claim is made here.+ /// <list type="bullet">+ /// <item>jaffa: the Knesset overview (K, https://m.knesset.gov.il/About/Occasion/Documents/IndependenceWar.pdf, p. 2),+ /// in its section "שלב ב': 1 באפריל עד 14 במאי 1948", says "התערבות הבריטים מנעה את כיבוש יפו בידי כוחות יהודיים+ /// (העיר נכנעה במאי)". It gives the month only, inside that section, which ends on 14 May 1948, the day before the+ /// game's start: so no villager stands at Jaffa in the game.</item>+ /// <item>lod: the Knesset overview's table of operations (p. 8) gives "כיבוש לוד ורמלה ומשלטי לטרון מצפון 9.7.1948–17.7.1948+ /// דני"; the IDF Danny account (D) and the IDF Archives' Rabin page (R, "In July 1948") give no day for Lydda. The+ /// range's last day, 17 July 1948, is the latest date the sources support.</item>+ /// <item>ramla: the IDF Danny account (D, https://jewishvirtuallibrary.org/jsource/History/Danny.html): "On July 12,+ /// Kiryati units took Ramle, which surrendered after a brief engagement."</item>+ /// <item>beersheba: the IDF Yoav account (Y, https://jewishvirtuallibrary.org/jsource/History/Yoav.html): "At 4:00 on+ /// the morning of 21 October, the IDF moved to capture Beersheba." and "by 09:00 hrs that morning, Beersheba - capital+ /// of the Negev had surrendered to Israeli forces."; the Knesset overview (p. 6): "ולכבוש את באר שבע ב-21 באוקטובר".</item>+ /// </list>+ /// The packet's fifth key (M, Morris) is a bibliographic record and gives no text to quote.</summary>+ public static readonly IReadOnlyDictionary<string, DateTime> VillagerUntil = new Dictionary<string, DateTime>(StringComparer.Ordinal)+ {+ ["jaffa"] = new DateTime(1948, 5, 14), ["lod"] = new DateTime(1948, 7, 17),+ ["ramla"] = new DateTime(1948, 7, 12), ["beersheba"] = new DateTime(1948, 10, 21),+ };++ /// <summary>Whether the villager stands at place <paramref name="id"/> on <paramref name="date"/>: the sim has+ /// residents there (<see cref="Inhabited"/>) and the date is not after the place's <see cref="VillagerUntil"/>.</summary>+ public static bool VillagerAt(IReadOnlyDictionary<string, SettlementControl>? control, string id, DateTime date) =>+ Inhabited(control, id) && !(VillagerUntil.TryGetValue(id, out var until) && date > until);++ /// <summary>Whether the sim has residents at place <paramref name="id"/>: inhabited unless its control record says+ /// depopulated (SettlementControl.Depopulated; docs/gdd/settlement-control.md: residents are a state, inhabited by+ /// default; a capture whose residents fled records them as gone). A place with no record is inhabited.</summary>+ public static bool Inhabited(IReadOnlyDictionary<string, SettlementControl>? control, string id) =>+ control == null || !control.TryGetValue(id, out var record) || !record.Depopulated;++ /// <summary>The anchors RuralLife's scenes of <paramref name="models"/> take: each model's first+ /// <see cref="RuralLife.MaxAnchorsPerModel"/> in its fixed hash order, each anchor once.</summary>+ public static List<RuralLife.Want> Served(IEnumerable<RuralLife.Want> rural, params string[] models)+ {+ var list = rural.ToList();+ var served = new List<RuralLife.Want>();+ foreach (var model in models)+ foreach (var want in list.Where(w => w.Model == model).Take(RuralLife.MaxAnchorsPerModel))+ if (!served.Any(x => x.Key == want.Key)) served.Add(want);+ return served;}static void AddGroup(string key, Vector2 anchor, float anchorRadius, IReadOnlyList<string> models, DateTime from,@@ -148,7 +269,9 @@ namespace Statecraft.Game.Map.Collectionstatic Vector2[] Offsets(int count, float turn){var offsets = new Vector2[count];- float radius = count == 2 ? FigureSpacingM * 0.5f : FigureSpacingM / Mathf.Sqrt(3f);+ // On a circle whose chord between neighbours is FigureSpacingM (a pair FigureSpacingM apart, a triangle of that+ // side, a square of that side); one figure stands on the spot.+ float radius = count == 1 ? 0f : FigureSpacingM / (2f * Mathf.Sin(Mathf.PI / count));float phase = turn * Mathf.Deg2Rad;for (int i = 0; i < count; i++){@@ -171,7 +294,8 @@ namespace Statecraft.Game.Map.Collectionpublic readonly List<string> Missing = new List<string>();public IReadOnlyList<Want> Wanted => wanted;- public static CivilianPeople? ShowAt(MapScene map, DateTime date, IEnumerable<Placement> placements, Content content)+ public static CivilianPeople? ShowAt(MapScene map, DateTime date, IEnumerable<Placement> placements, Content content,+ IReadOnlyDictionary<string, SettlementControl>? control = null, IEnumerable<CityProject>? projects = null){if (map == null || map.Terrain == null || map.Hexes == null) return null;var layer = map.Terrain.transform.Find(Name)?.GetComponent<CivilianPeople>();@@ -182,13 +306,12 @@ namespace Statecraft.Game.Map.Collectionlayer = go.AddComponent<CivilianPeople>();layer.map = map;}- layer.Show(date, placements, content);+ layer.Show(Wants(map, date, placements, content, control, projects));return layer;}- void Show(DateTime at, IEnumerable<Placement> nextPlacements, Content nextContent)+ void Show(List<Want> next){- var next = Wants(map!, at, nextPlacements, nextContent);if (next.SequenceEqual(wanted)) return;wanted = next;Ask(CollectionDetail.Far);@@ -258,7 +381,7 @@ namespace Statecraft.Game.Map.Collection// Compose the seeded yaw on top of the prefab root's FBX -90-degree X conversion (#979).go.transform.localRotation = Quaternion.Euler(0f, want.Yaw, 0f) * prefab.transform.localRotation;var before = Bounds(go);- go.transform.localScale *= before.size.y > 1e-3f ? FigureHeightM / before.size.y : FigureScale;+ go.transform.localScale *= before.size.y > 1e-3f ? HeightOf(want.Model) / before.size.y : FigureScale;go.transform.position = want.At;var after = Bounds(go);go.transform.position += new Vector3(want.At.x - after.center.x, want.At.y - after.min.y, want.At.z - after.center.z);diff --git a/unity/Assets/Scripts/Map/Collection/CollectionCatalog.cs b/unity/Assets/Scripts/Map/Collection/CollectionCatalog.csindex 20e959857..4d3cf410c 100644--- a/unity/Assets/Scripts/Map/Collection/CollectionCatalog.cs+++ b/unity/Assets/Scripts/Map/Collection/CollectionCatalog.cs@@ -14,7 +14,10 @@ namespace Statecraft.Game.Map.Collection/// #663; owner, 17 October 2026: "The nine whole-town models ship"), standing on their towns far off (<see cref="TownLandmarks"/>);/// and ten models offered only in #336, by Tal Heuberger: eight figures (issue #708; owner, 18 October 2026: "the 8 figures/// in #708 can be merged without his license line"), the pioneer farmer and a second Jerusalem town (issue #886; owner,- /// 19 October 2026: "Yes, both"), imported but not yet placed.+ /// 19 October 2026: "Yes, both"), placed by CivilianPeople, UnitFigures (the soldier) and TownLandmarks (the second+ /// Jerusalem, the city's only far-zoom model) (#708). Every model is placed but two, each by an owner ruling: b21, which+ /// waits for a sourced location (owner: wait), and #507's first Jerusalem, kept in the repository unused on the map+ /// (owner, 21 October 2026, #708)./// They are slimmed by/// tools/slim_collection.py and live in <see cref="Folder"/>/<id>/, outside every Resources folder. Each ships as two/// prefabs, <id>-far and <id>-near, in its category's AssetBundle, which the game streams after the first framediff --git a/unity/Assets/Scripts/Map/Collection/TownLandmarks.cs b/unity/Assets/Scripts/Map/Collection/TownLandmarks.csindex 1a632dbc5..19d4d033b 100644--- a/unity/Assets/Scripts/Map/Collection/TownLandmarks.cs+++ b/unity/Assets/Scripts/Map/Collection/TownLandmarks.cs@@ -54,12 +54,15 @@ namespace Statecraft.Game.Map.Collectionpublic const string TelAviv = "tel-aviv-white-city-v1", Jerusalem = "jerusalem-stone-city-v1", Haifa = "haifa-port-city-v1",Moshava = "moshava-town-v1", Nahalal = "nahalal-moshav-v1", Kibbutz = "kibbutz-compound-v2", StoneVillage = "stone-village-v1",- Maabara = "maabara-camp-v1", Shikun = "shikun-housing-v1";+ Maabara = "maabara-camp-v1", Shikun = "shikun-housing-v1", Jerusalem3D = "jerusalem-stone-city-v1-3denhance";- /// <summary>By settlement id first (#507's mapping).</summary>+ /// <summary>By settlement id first (#507's mapping). Jerusalem stands as #336's second take of the stone city+ /// (<see cref="Jerusalem3D"/>, Tal Heuberger, #886) for the whole game: the owner, 21 October 2026, on #708+ /// (issuecomment-6323524970), "it is Jerusalem's only far-zoom model for the whole game. The first model stays in the+ /// repository, unused on the map. No date switch". #507's <see cref="Jerusalem"/> is therefore not placed.</summary>public static readonly IReadOnlyDictionary<string, string> ById = new Dictionary<string, string>(StringComparer.Ordinal){- ["tel_aviv"] = TelAviv, ["jerusalem"] = Jerusalem, ["haifa"] = Haifa,+ ["tel_aviv"] = TelAviv, ["jerusalem"] = Jerusalem3D, ["haifa"] = Haifa,["petah_tikva"] = Moshava, ["rishon_lezion"] = Moshava, ["zikhron_yaakov"] = Moshava,["rosh_pinna"] = Moshava, ["rehovot"] = Moshava, ["hadera"] = Moshava,};diff --git a/unity/Assets/Scripts/Map/Units/UnitFigures.cs b/unity/Assets/Scripts/Map/Units/UnitFigures.csindex fa16d31f3..b4b0e9365 100644--- a/unity/Assets/Scripts/Map/Units/UnitFigures.cs+++ b/unity/Assets/Scripts/Map/Units/UnitFigures.cs@@ -28,7 +28,7 @@ namespace Statecraft.Game.Map.Unitspublic const string SabraPioneer = "figure-c04-sabra-pioneer-v3", PioneerVeteran = "figure-c05-pioneer-veteran-v2",YoungRecruit = "figure-c06-young-recruit-v2", VeteranFighter = "figure-c07-veteran-fighter-v2",- PalmachScout = "figure-c12f-palmach-scout-v2", ArabLegion = "figure-c08-arab-legion-v2", Irregular = "figure-c09-irregular-v2",+ PalmachScout = "figure-c12f-palmach-scout-v2", Soldier1948 = "figure-soldier-1948-v1", ArabLegion = "figure-c08-arab-legion-v2", Irregular = "figure-c09-irregular-v2",Napoleonchik = "figure-vehicle-napoleonchik-65mm-1948-v2", WillysJeep = "figure-vehicle-willys-jeep-1948-v2";/// <summary>An Israeli rifleman's figure by his headgear (the sourced <see cref="UnitEntry.Headgear"/>, or the uniform@@ -45,10 +45,22 @@ namespace Statecraft.Game.Map.Units/// battalions escorted the convoys between Sha'ar HaGai, where its token stands, and Saris (its anchor, Izkor);/// a Palmach woman's duties included "escorting convoys" (https://en.wikipedia.org/wiki/Netiva_Ben-Yehuda, checked/// 2026-10-18), and the Palmach memorial site records 34 of its women killed, seventeen in action- /// (https://en.wikipedia.org/wiki/Palmach, checked 2026-10-18).</summary>+ /// (https://en.wikipedia.org/wiki/Palmach, checked 2026-10-18).+ /// Yiftach's and Negev's is #336's 1948 soldier (owner, 21 October 2026, through the coordinator: "place it as a third+ /// figure on some brigade unit tokens, next to C06 and C07"): a rifleman in khaki wearing the knitted stocking cap, the+ /// Palmach's (as C07 wears it), so he stands third on the other two Palmach brigades, the 11th and 12th (their rows'+ /// numbers, palmach.org.il). On Negev's token he takes the third figure's sourced cap from C07+ /// (<see cref="ThirdOverHeadgear"/>), so it shows C07, C06 and the soldier.</summary>public static readonly IReadOnlyDictionary<string, string> ThirdFigure = new Dictionary<string, string>(StringComparer.Ordinal){- ["harel"] = PalmachScout,+ ["harel"] = PalmachScout, ["yiftach"] = Soldier1948, ["negev"] = Soldier1948,+ };++ /// <summary>The headgear a sourced third figure must wear for a <see cref="ThirdFigure"/> row to stand in its place: the+ /// soldier's knitted stocking cap, so a row never changes what its headgear source shows.</summary>+ public static readonly IReadOnlyDictionary<string, string> ThirdOverHeadgear = new Dictionary<string, string>(StringComparer.Ordinal)+ {+ [Soldier1948] = UnitData.WoolCap,};/// <summary>An Arab force's figures, by its side: the Arab Legion (C08) for Transjordan's army, the irregular (C09) for@@ -75,7 +87,9 @@ namespace Statecraft.Game.Map.Unitspublic static string? FigureFor(UnitEntry u, int index, string? headgear){if (u.Side != UnitData.Israel) return SideFigure(u.Side);- if (index == 2 && u.Headgear == null) return ThirdFigure.TryGetValue(u.Id, out var third) ? third : PioneerVeteran;+ if (index == 2 && ThirdFigure.TryGetValue(u.Id, out var third)+ && (u.Headgear == null || ThirdOverHeadgear.TryGetValue(third, out var cap) && cap == headgear)) return third;+ if (index == 2 && u.Headgear == null) return PioneerVeteran;return headgear != null && ByHeadgear.TryGetValue(headgear, out var id) ? id : null;}diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.csindex 87a72d759..a81651678 100644--- a/unity/Assets/Scripts/UI/GameRoot.cs+++ b/unity/Assets/Scripts/UI/GameRoot.cs@@ -626,8 +626,10 @@ namespace Statecraft.Game.UIPlacementLayer.Drawn(Bridge.State.Placements, Bridge.State.CityProjects.Values), Bridge.Content);// Tal Heuberger's ibex and striped hyena, sparse in their sourced terrain zones and visible only at close zoom (#670).Statecraft.Game.Map.Collection.WildlifeLayer.Show(map);- // Tal Heuberger's civilian figures at towns and transit camps, ambience only and streamed after the first frame (#666).- Statecraft.Game.Map.Collection.CivilianPeople.ShowAt(map, Bridge.State.Date, Bridge.State.Placements, Bridge.Content);+ // Tal Heuberger's civilian figures at towns, villages, transit camps and building sites, ambience only and streamed+ // after the first frame (#666, #708, #886): the residents follow the settlement state, the builders the projects.+ Statecraft.Game.Map.Collection.CivilianPeople.ShowAt(map, Bridge.State.Date, Bridge.State.Placements, Bridge.Content,+ Bridge.State.Settlements, Bridge.State.CityProjects.Values);// Tal Heuberger's period-generic farm and village scenery, streamed after the first frame (#667); never game units.Statecraft.Game.Map.Collection.RuralLife.Show(map);// Tal Heuberger's Tegart fort, barracks and factory at their sourced places and dates, close up only, streamed (#707).diff --git a/unity/Assets/Tests/EditMode/CivilianPeopleTests.cs b/unity/Assets/Tests/EditMode/CivilianPeopleTests.csindex c0ce3f260..d19f3c444 100644--- a/unity/Assets/Tests/EditMode/CivilianPeopleTests.cs+++ b/unity/Assets/Tests/EditMode/CivilianPeopleTests.cs@@ -80,7 +80,7 @@ public sealed class CivilianPeopleTestsAssert.IsNull(Resources.Load<GameObject>(id), id + " is never in the first-frame Resources load");}CollectionAssert.AreEquivalent(new[] { "city", "town", "kibbutz", "moshav" }, CivilianPeople.SettledTypes);- CollectionAssert.DoesNotContain(CivilianPeople.SettledTypes, "arab_town", "the Arab towns wait for the Arab villager figure (#708)");+ CollectionAssert.DoesNotContain(CivilianPeople.SettledTypes, "arab_town", "the Arab towns get the Arab villager, not the C-series set (#708)");}[Test]@@ -91,12 +91,13 @@ public sealed class CivilianPeopleTestsvar hex = content.SettlementHexes.Single(s => s.Id == "revivim");var camp = new[] { new Placement(MapActions.TransitCamp, hex.Q, hex.R, new DateTime(1950, 8, 1)) };- var before = CivilianPeople.Wants(map, new DateTime(1950, 7, 31), camp, content);+ bool CSeries(CivilianPeople.Want w) => CivilianPeople.SettledModels.Contains(w.Model) || CivilianPeople.CampModels.Contains(w.Model);+ var before = CivilianPeople.Wants(map, new DateTime(1950, 7, 31), camp, content).Where(CSeries).ToList();int settlements = map.Settlements.Count(s => CivilianPeople.SettledTypes.Contains(s.Type));Assert.AreEqual(settlements * CivilianPeople.SettledGroupSize, before.Count);CollectionAssert.DoesNotContain(before.Select(w => w.Model), CivilianPeople.ArrivingMan);- var from = CivilianPeople.Wants(map, new DateTime(1950, 8, 1), camp, content);+ var from = CivilianPeople.Wants(map, new DateTime(1950, 8, 1), camp, content).Where(CSeries).ToList();Assert.AreEqual(settlements * CivilianPeople.SettledGroupSize + CivilianPeople.CampGroupSize, from.Count);CollectionAssert.AreEqual(CivilianPeople.CampModels,from.Where(w => w.Key.StartsWith("transit_camp_", StringComparison.Ordinal)).Select(w => w.Model));@@ -114,7 +115,7 @@ public sealed class CivilianPeopleTestsCollectionAssert.AreEqual(first, second, "same ids and seed give bit-for-bit equal plans");var layer = CivilianPeople.ShowAt(map, new DateTime(1949, 1, 1), Array.Empty<Placement>(), content)!;- Assert.AreEqual(3, asked.Count, "only the three far settled models, once each");+ Assert.AreEqual(first.Select(w => w.Model).Distinct().Count(), asked.Count, "each wanted far model, once");Assert.IsTrue(asked.All(a => a.detail == CollectionDetail.Far));CollectionAssert.IsEmpty(layer.Placed, "the stream never answers in the requesting frame");Answer(CollectionDetail.Far);@@ -151,7 +152,8 @@ public sealed class CivilianPeopleTestsvar prefab = Prefab(p.Model, CollectionDetail.Far);var expected = layer.transform.rotation * Quaternion.Euler(0f, p.Yaw, 0f) * prefab.transform.localRotation;Assert.Less(Quaternion.Angle(expected, child!.rotation), 0.01f, p.Key + " upright");- Assert.AreEqual(CivilianPeople.FigureHeightM, WorldBounds(child.gameObject).size.y, CivilianPeople.FigureHeightM * 0.02f, p.Key + " height at the world scale");+ float tall = CivilianPeople.HeightOf(p.Model);+ Assert.AreEqual(tall, WorldBounds(child.gameObject).size.y, tall * 0.02f, p.Key + " height at the world scale");Assert.IsTrue(child.GetComponentsInChildren<Renderer>(true).All(r => r.sharedMaterial.enableInstancing), p.Key + " is GPU-instanced");}}@@ -194,7 +196,7 @@ public sealed class CivilianPeopleTeststry{layer.Choose(default, camera);- Assert.AreEqual(3, asked.Count, "near models asked once on entering close zoom");+ Assert.AreEqual(layer.Wanted.Select(w => w.Model).Distinct().Count(), asked.Count, "near models asked once on entering close zoom");Assert.IsTrue(asked.All(a => a.detail == CollectionDetail.Near));Assert.IsTrue(layer.GetComponentsInChildren<Renderer>(true).Any(r => !r.forceRenderingOff), "far figures remain while near streams");Answer(CollectionDetail.Near);@@ -221,6 +223,245 @@ public sealed class CivilianPeopleTestsAssert.AreEqual(layer.Wanted.Count(w => w.Model == CivilianPeople.Townsman), layer.Missing.Count(k => k.EndsWith("/0", StringComparison.Ordinal)));}+ // ---- #708 and #886: Tal Heuberger's figures offered in #336 ----++ static string Group(CivilianPeople.Want w) => w.Key.Substring(0, w.Key.LastIndexOf('/'));+ static string Place(CivilianPeople.Want w) => Group(w).Split(':')[0];+ static List<string> ModelsAt(IEnumerable<CivilianPeople.Want> wants, string group) =>+ wants.Where(w => Group(w) == group).Select(w => w.Model).ToList();++ /// <summary>Every place type the map knows by id: the game settlements and the 1948 localities.</summary>+ static Dictionary<string, string> Types(MapScene map)+ {+ var types = map.Settlements.ToDictionary(s => s.Id, s => s.Type, StringComparer.Ordinal);+ foreach (var p in map.Localities) if (!types.ContainsKey(p.Settlement.Id)) types[p.Settlement.Id] = p.Settlement.Type;+ return types;+ }++ /// <summary>Each figure of #336 has a placement table here and its places resolve on the map: the Arab villager at the seven+ /// Arab towns and the villages whose flocks RuralLife draws, the kibbutz woman at every kibbutz, the pioneer farmer at the+ /// moshav and the kibbutzim whose tractors RuralLife draws. Nobody else stands at an Arab town, and no figure stands at+ /// a place of another kind.</summary>+ [Test]+ public void TheVillagerKibbutzWomanAndFarmerStandAtTheirPlacesInNormalPlay()+ {+ var map = OpenMap();+ var content = ContentLoader.Load(Statecraft.Game.Paths.Content);+ var types = Types(map);+ var plan = CivilianPeople.Wants(map, new DateTime(1949, 1, 1), Array.Empty<Placement>(), content);+ var rural = RuralLife.Wants(map);++ var arabTowns = map.Settlements.Where(s => s.Type == "arab_town").Select(s => s.Id).ToList();+ CollectionAssert.AreEquivalent(new[] { "jaffa", "acre", "nazareth", "lod", "ramla", "gaza", "beersheba" }, arabTowns,+ "the seven Arab towns, each with the stone village (TownLandmarks.ByType)");+ var villages = CivilianPeople.Served(rural, RuralLife.Sheep, RuralLife.Donkey).Select(w => w.Key).ToList();+ Assert.That(villages.Count, Is.InRange(RuralLife.MaxAnchorsPerModel, 2 * RuralLife.MaxAnchorsPerModel));+ Assert.IsTrue(villages.All(v => types[v] == "village"), "the flocks' villages");+ // On 1 January 1949, after the four sourced dates (TheVillagerLeavesFourTownsAfterTheirSourcedDates), three towns keep him.+ var shown = arabTowns.Where(id => !CivilianPeople.VillagerUntil.ContainsKey(id)).ToList();+ CollectionAssert.AreEquivalent(new[] { "acre", "nazareth", "gaza" }, shown);+ foreach (var id in shown.Concat(villages))+ CollectionAssert.AreEqual(new[] { CivilianPeople.ArabVillager }, ModelsAt(plan, id + ":villager"), id + ": one villager beside it");+ var villagers = plan.Where(w => w.Model == CivilianPeople.ArabVillager).ToList();+ Assert.AreEqual(shown.Count + villages.Count, villagers.Count);+ Assert.IsTrue(villagers.All(w => types[Place(w)] == "arab_town" || types[Place(w)] == "village"), "only at the Arab towns and villages");+ Assert.IsTrue(plan.Where(w => arabTowns.Contains(Place(w))).All(w => w.Model == CivilianPeople.ArabVillager),+ "nobody else at the Arab towns (#666's ruling: they wait for the Arab villager)");++ var kibbutzim = map.Settlements.Where(s => s.Type == "kibbutz").Select(s => s.Id).ToList();+ Assert.Greater(kibbutzim.Count, 0);+ foreach (var id in kibbutzim)+ CollectionAssert.AreEqual(new[] { CivilianPeople.KibbutzWoman }, ModelsAt(plan, id + ":kibbutz-woman"), id);+ Assert.AreEqual(kibbutzim.Count, plan.Count(w => w.Model == CivilianPeople.KibbutzWoman));++ var fields = map.Settlements.Where(s => s.Type == "moshav").Select(s => s.Id)+ .Concat(CivilianPeople.Served(rural, RuralLife.Tractor).Select(w => w.Key)).Distinct().ToList();+ Assert.Greater(fields.Count, RuralLife.MaxAnchorsPerModel - 1, "the moshav and the tractors' kibbutzim");+ foreach (var id in fields)+ {+ Assert.That(types[id], Is.EqualTo("moshav").Or.EqualTo("kibbutz"), id);+ CollectionAssert.AreEqual(new[] { CivilianPeople.PioneerFarmer }, ModelsAt(plan, id + ":farmer"), id);+ }+ Assert.AreEqual(fields.Count, plan.Count(w => w.Model == CivilianPeople.PioneerFarmer));++ foreach (var id in CivilianPeople.ImmigrantModels.Append(CivilianPeople.YemeniteImmigrant).Append(CivilianPeople.Builder))+ CollectionAssert.DoesNotContain(plan.Select(w => w.Model), id, id + ": no camp or project built yet");+ }++ /// <summary>The villager stands only where the sim has residents (docs/gdd/settlement-control.md: residents are a state,+ /// inhabited by default): a captured town still awaiting its outcome keeps him; a place the sim records as depopulated+ /// shows none, a town or a village alike, and the rest stay.</summary>+ [Test]+ public void TheVillagerIsNotShownWhereTheResidentsFled()+ {+ var map = OpenMap();+ var content = ContentLoader.Load(Statecraft.Game.Paths.Content);+ var date = new DateTime(1948, 8, 15);+ var village = CivilianPeople.Served(RuralLife.Wants(map), RuralLife.Sheep)[0].Key;+ var control = new Dictionary<string, SettlementControl>(StringComparer.Ordinal)+ {+ ["nazareth"] = new SettlementControl("israel", "", new DateTime(1948, 7, 15), depopulated: true),+ ["acre"] = new SettlementControl("israel", SettlementControl.AwaitingChoice, new DateTime(1948, 7, 15)),+ [village] = new SettlementControl("israel", "", new DateTime(1948, 7, 15), depopulated: true),+ };+ var all = CivilianPeople.Wants(map, date, Array.Empty<Placement>(), content);+ var fled = CivilianPeople.Wants(map, date, Array.Empty<Placement>(), content, control);+ Assert.IsNotEmpty(ModelsAt(all, "nazareth:villager"), "inhabited without a record");+ Assert.IsNotEmpty(ModelsAt(all, village + ":villager"));+ CollectionAssert.IsEmpty(ModelsAt(fled, "nazareth:villager"), "a place the sim records as depopulated");+ CollectionAssert.IsEmpty(ModelsAt(fled, village + ":villager"), "a village's residents fled");+ CollectionAssert.AreEqual(new[] { CivilianPeople.ArabVillager }, ModelsAt(fled, "acre:villager"), "a capture awaiting its outcome changes no residents");+ Assert.AreEqual(all.Count(w => w.Model == CivilianPeople.ArabVillager) - 2, fled.Count(w => w.Model == CivilianPeople.ArabVillager));+ Assert.IsTrue(fled.Where(w => w.Model != CivilianPeople.ArabVillager).All(w => !Place(w).Equals("nazareth", StringComparison.Ordinal)),+ "nobody stands in for them");+ }++ /// <summary>The owner, 21 October 2026, on #708: "hide each town's villager after its sourced date", from the #793+ /// packet's sources only (CivilianPeople.VillagerUntil quotes each). Jaffa's source puts its surrender in May, in a section+ /// that ends on 14 May 1948, so he never stands there in the game; Lod's is the last day of Operation Dani's range in the+ /// Knesset table, 17 July 1948; Ramle's 12 July 1948 (IDF Danny account); Beersheba's 21 October 1948 (IDF Yoav account,+ /// Knesset). He stands up to and on each date, and not after; no other town or village has a date.</summary>+ [Test]+ public void TheVillagerLeavesFourTownsAfterTheirSourcedDates()+ {+ CollectionAssert.AreEquivalent(new Dictionary<string, DateTime>+ {+ ["jaffa"] = new DateTime(1948, 5, 14), ["lod"] = new DateTime(1948, 7, 17),+ ["ramla"] = new DateTime(1948, 7, 12), ["beersheba"] = new DateTime(1948, 10, 21),+ }, CivilianPeople.VillagerUntil);+ var map = OpenMap();+ var content = ContentLoader.Load(Statecraft.Game.Paths.Content);+ Assert.Greater(content.Rules.Start, CivilianPeople.VillagerUntil["jaffa"], "Jaffa's date is before the game starts");+ CollectionAssert.IsEmpty(ModelsAt(CivilianPeople.Wants(map, content.Rules.Start, Array.Empty<Placement>(), content), "jaffa:villager"),+ "no villager at Jaffa from the start");+ foreach (var id in new[] { "lod", "ramla", "beersheba" })+ {+ var until = CivilianPeople.VillagerUntil[id];+ CollectionAssert.AreEqual(new[] { CivilianPeople.ArabVillager }, ModelsAt(CivilianPeople.Wants(map, until, Array.Empty<Placement>(), content), id + ":villager"),+ $"{id} on {until:d MMM yyyy}");+ CollectionAssert.IsEmpty(ModelsAt(CivilianPeople.Wants(map, until.AddDays(1), Array.Empty<Placement>(), content), id + ":villager"),+ $"{id} after {until:d MMM yyyy}");+ }+ var late = CivilianPeople.Wants(map, new DateTime(1951, 12, 15), Array.Empty<Placement>(), content);+ foreach (var id in new[] { "acre", "nazareth", "gaza" })+ CollectionAssert.AreEqual(new[] { CivilianPeople.ArabVillager }, ModelsAt(late, id + ":villager"), id + " has no date");+ Assert.IsTrue(CivilianPeople.VillagerUntil.Keys.All(id => map.Settlements.Single(s => s.Id == id).Type == "arab_town"));+ }++ /// <summary>The elder immigrant, the child and the immigrant woman stand beside C01 and C10 at every built transit camp, from+ /// the camp's date, whether the legacy loop placed it or the GDD loop built it as a city project (#1123); the Yemenite+ /// immigrant joins them only inside Operation Magic Carpet's window (1 July 1949 to 24 September 1950, as the C-54 at+ /// Lod, SeaAirCollection).</summary>+ [Test]+ public void TheImmigrantsStandWithC01AndC10AtEveryCampAndTheYemeniteOnlyInHisWindow()+ {+ var map = OpenMap();+ var content = ContentLoader.Load(Statecraft.Game.Paths.Content);+ Assert.AreEqual(new DateTime(1949, 7, 1), CivilianPeople.YemeniteFrom, "Magic Carpet's main wave (SeaAirCollection.C54From)");+ Assert.AreEqual(new DateTime(1950, 9, 24), CivilianPeople.YemeniteTo, "the last two aircraft reach Lydda (SeaAirCollection.C54To)");+ var revivim = content.SettlementHexes.Single(s => s.Id == "revivim");+ var tel = content.SettlementHexes.Single(s => s.Id == "tel_aviv");+ string camp = $"{MapActions.TransitCamp}_{revivim.Q}_{revivim.R}", built = $"{MapActions.TransitCamp}_{tel.Q}_{tel.R}";+ var legacy = new[] { new Placement(MapActions.TransitCamp, revivim.Q, revivim.R, new DateTime(1949, 6, 15)) };+ var projects = new[] { new CityProject(4, MapActions.TransitCamp, "tel_aviv", tel.Q, tel.R, 0, new DateTime(1950, 2, 15)) };+ List<CivilianPeople.Want> At(DateTime d) => CivilianPeople.Wants(map, d, legacy, content, null, projects);++ var june = At(new DateTime(1949, 6, 30));+ CollectionAssert.AreEqual(CivilianPeople.CampModels, ModelsAt(june, camp));+ CollectionAssert.AreEqual(CivilianPeople.ImmigrantModels, ModelsAt(june, camp + ":immigrants"), "before Magic Carpet's window");+ CollectionAssert.IsEmpty(ModelsAt(june, built), "the project is not built yet");+ var july = At(CivilianPeople.YemeniteFrom);+ CollectionAssert.AreEqual(CivilianPeople.ImmigrantModels.Append(CivilianPeople.YemeniteImmigrant), ModelsAt(july, camp + ":immigrants"));+ var march = At(new DateTime(1950, 3, 15));+ CollectionAssert.AreEqual(CivilianPeople.CampModels, ModelsAt(march, built), "C01 and C10 at the GDD loop's built camp");+ CollectionAssert.AreEqual(CivilianPeople.ImmigrantModels.Append(CivilianPeople.YemeniteImmigrant), ModelsAt(march, built + ":immigrants"));+ CollectionAssert.AreEqual(CivilianPeople.ImmigrantModels.Append(CivilianPeople.YemeniteImmigrant), ModelsAt(At(CivilianPeople.YemeniteTo), camp + ":immigrants"));+ var october = At(new DateTime(1950, 10, 15));+ CollectionAssert.AreEqual(CivilianPeople.ImmigrantModels, ModelsAt(october, camp + ":immigrants"), "after the last flight");+ CollectionAssert.DoesNotContain(october.Select(w => w.Model), CivilianPeople.YemeniteImmigrant);+ CollectionAssert.DoesNotContain(At(new DateTime(1949, 6, 30)).Select(w => w.Model), CivilianPeople.YemeniteImmigrant);++ // Beside C01 and C10: both groups take the camp's hex as their anchor, within the bounded search of each other.+ float reach = 2f * (map.Hexes!.hex_size_km * 1000f + CivilianPeople.LabelClearanceM + CivilianPeople.SearchRings * CivilianPeople.SearchStepM+ + 2f * CivilianPeople.FigureSpacingM);+ Vector3 Centre(IEnumerable<CivilianPeople.Want> ws, string g) => ws.Where(w => Group(w) == g).Aggregate(Vector3.zero, (a, w) => a + w.At) / ws.Count(w => Group(w) == g);+ Assert.Less(Vector3.Distance(Centre(march, built), Centre(march, built + ":immigrants")), reach);+ // Four in a group stand a full spacing apart.+ var four = march.Where(w => Group(w) == built + ":immigrants").ToList();+ for (int i = 0; i < four.Count; i++)+ for (int j = i + 1; j < four.Count; j++)+ Assert.GreaterOrEqual(Vector3.Distance(four[i].At, four[j].At), CivilianPeople.FigureSpacingM - 1f);+ }++ /// <summary>The builder stands at each of the player's city projects (a housing project, industry, a transit camp) while+ /// it is being built (CityProject.BuiltOn null), and leaves when it is built.</summary>+ [Test]+ public void TheBuilderWorksAtEachCityProjectOnlyWhileItIsBeingBuilt()+ {+ var map = OpenMap();+ var content = ContentLoader.Load(Statecraft.Game.Paths.Content);+ var tel = content.SettlementHexes.Single(s => s.Id == "tel_aviv");+ var haifa = content.SettlementHexes.Single(s => s.Id == "haifa");+ var date = new DateTime(1950, 3, 15);+ var building = new[]+ {+ new CityProject(7, MapActions.Housing, "tel_aviv", tel.Q, tel.R, 3),+ new CityProject(8, MapActions.TransitCamp, "haifa", haifa.Q, haifa.R, 1),+ };+ var plan = CivilianPeople.Wants(map, date, Array.Empty<Placement>(), content, null, building);+ CollectionAssert.AreEqual(new[] { CivilianPeople.Builder }, ModelsAt(plan, "project_7:builder"));+ CollectionAssert.AreEqual(new[] { CivilianPeople.Builder }, ModelsAt(plan, "project_8:builder"));+ CollectionAssert.DoesNotContain(plan.Select(w => w.Model), CivilianPeople.ArrivingMan, "a camp being built has no arrivals yet");+ var done = CivilianPeople.Wants(map, date, Array.Empty<Placement>(), content, null, building.Select(p => p.Built(new DateTime(1950, 2, 15))));+ CollectionAssert.DoesNotContain(done.Select(w => w.Model), CivilianPeople.Builder, "the builders leave once it is built");+ CollectionAssert.IsNotEmpty(ModelsAt(done, $"{MapActions.TransitCamp}_{haifa.Q}_{haifa.R}"), "and the built camp takes its arrivals");+ }++ /// <summary>#336's figures stream from the people bundle like the C series, never from Resources.</summary>+ [Test]+ public void TheNewFiguresStreamFromThePeopleBundle()+ {+ foreach (var id in CivilianPeople.Models)+ {+ Assert.AreEqual(CollectionCatalog.People, CollectionCatalog.BundleOf(id), id);+ foreach (var detail in new[] { CollectionDetail.Far, CollectionDetail.Near })+ {+ StringAssert.DoesNotContain("/Resources/", CollectionCatalog.PrefabPath(id, detail));+ Assert.IsNotNull(Prefab(id, detail), id + " " + detail);+ }+ Assert.IsNull(Resources.Load<GameObject>(id), id + " is never in the first-frame Resources load");+ Assert.IsTrue(CollectionCatalog.Animated.Contains(id), id + " has an idle clip up close");+ }+ Assert.Less(CivilianPeople.ChildHeightM, CivilianPeople.FigureHeightM, "the child is shorter than the adults");+ }++ /// <summary>The owner on #336: "we must make sure all of his models are in and fully used". Every model the catalog+ /// streams is in some layer's placement table, but two, each by an owner ruling: b21, the artisan workshop, which waits+ /// for a sourced location (owner: wait), and #507's first Jerusalem, which "stays in the repository, unused on the map"+ /// now that #336's second Jerusalem is the city's only far-zoom model (owner, 21 October 2026, #708).</summary>+ [Test]+ public void EveryCatalogModelIsPlacedButTheTwoTheOwnerHeldBack()+ {+ var placed = new HashSet<string>(StringComparer.Ordinal);+ placed.UnionWith(CivilianPeople.Models);+ placed.UnionWith(RuralLife.Models);+ placed.UnionWith(new[] { WildlifeLayer.Ibex, WildlifeLayer.Hyena });+ placed.UnionWith(new[] { SeaAirCollection.Altalena, SeaAirCollection.FishingBoat, SeaAirCollection.Steamer, SeaAirCollection.C54 });+ placed.UnionWith(new[] { Statecraft.Game.Map.Routes.ServiceTrain.ModelId, Statecraft.Game.Map.Routes.RoadVehicles.CitrusTruck,+ Statecraft.Game.Map.Routes.RoadVehicles.CanvasLorry, Statecraft.Game.Map.Routes.RoadVehicles.SandwichConvoy,+ Statecraft.Game.Map.Routes.RoadVehicles.IntercityBus });+ placed.UnionWith(new[] { SpecialBuildingModels.Shikun, SpecialBuildingModels.Tegart, SpecialBuildingModels.Barracks, SpecialBuildingModels.Factory });+ placed.UnionWith(TownLandmarks.ById.Values.Concat(TownLandmarks.ByType.Values).Concat(TownLandmarks.ByAction.Values.Select(v => v.Model))+);+ var units = Statecraft.Game.Map.Units.UnitFigures.ByHeadgear.Values.Concat(Statecraft.Game.Map.Units.UnitFigures.ThirdFigure.Values)+ .Concat(Statecraft.Game.Map.Units.UnitFigures.BySide.Values).Concat(Statecraft.Game.Map.Units.UnitFigures.ByVehicle.Values)+ .Append(Statecraft.Game.Map.Units.UnitFigures.PioneerVeteran);+ placed.UnionWith(units);+ CollectionAssert.AreEquivalent(new[] { SpecialBuildingModels.Workshop, TownLandmarks.Jerusalem }, CollectionCatalog.Ids.Where(id => !placed.Contains(id)).ToList(),+ "every catalogued model has a place but b21 and the first Jerusalem, each held back by an owner ruling");+ CollectionAssert.IsSubsetOf(placed.ToList(), CollectionCatalog.Ids.ToList(), "every placed id is a catalogued model");+ }+static Camera CameraAt(float distanceM){var camera = new GameObject("People camera").AddComponent<Camera>();diff --git a/unity/Assets/Tests/EditMode/TownLandmarksTests.cs b/unity/Assets/Tests/EditMode/TownLandmarksTests.csindex 5a02e1c27..6970c93ea 100644--- a/unity/Assets/Tests/EditMode/TownLandmarksTests.cs+++ b/unity/Assets/Tests/EditMode/TownLandmarksTests.cs@@ -41,7 +41,7 @@ public class TownLandmarksTestsstatic readonly string[] Towns ={- "tel-aviv-white-city-v1", "jerusalem-stone-city-v1", "haifa-port-city-v1", "moshava-town-v1", "nahalal-moshav-v1",+ "tel-aviv-white-city-v1", "jerusalem-stone-city-v1-3denhance", "haifa-port-city-v1", "moshava-town-v1", "nahalal-moshav-v1","kibbutz-compound-v2", "stone-village-v1", "maabara-camp-v1", "shikun-housing-v1",};@@ -66,7 +66,7 @@ public class TownLandmarksTestspublic void EveryTownModelIsUsedAndEachIsInTheStreamedTownsBundle(){var used = TownLandmarks.ById.Values.Concat(TownLandmarks.ByType.Values).Concat(TownLandmarks.ByAction.Values.Select(v => v.Model)).Distinct();- CollectionAssert.AreEquivalent(Towns, used, "all nine, as #507 mapped them");+ CollectionAssert.AreEquivalent(Towns, used, "all nine, as #507 mapped them, with #336's second Jerusalem for #507's (owner, 21 October 2026, #708)");foreach (var id in Towns) Assert.AreEqual(CollectionCatalog.Towns, CollectionCatalog.BundleOf(id), id);Assert.AreEqual(TownLandmarks.TelAviv, TownLandmarks.ById["tel_aviv"]);Assert.AreEqual(TownLandmarks.Kibbutz, TownLandmarks.ByType["kibbutz"]);@@ -87,6 +87,28 @@ public class TownLandmarksTestsAssert.IsNull(TownLandmarks.ModelFor("no_such_action", new DateTime(1951, 1, 1)));}+ /// <summary>The owner, 21 October 2026, on #708 (issuecomment-6323524970): #336's second Jerusalem (#886) "is Jerusalem's+ /// only far-zoom model for the whole game. The first model stays in the repository, unused on the map. No date switch".+ /// It streams from the towns bundle and stands on Jerusalem's core on every date; #507's first Jerusalem is never asked for.</summary>+ [Test]+ public void JerusalemIsTheSecondStoneCityOnEveryDate()+ {+ Assert.AreEqual(CollectionCatalog.Towns, CollectionCatalog.BundleOf(TownLandmarks.Jerusalem3D));+ Assert.AreEqual(TownLandmarks.Jerusalem3D, TownLandmarks.ById["jerusalem"]);+ CollectionAssert.DoesNotContain(TownLandmarks.ById.Values.Concat(TownLandmarks.ByType.Values).ToList(), TownLandmarks.Jerusalem,+ "#507's first Jerusalem stays in the repository, unused on the map");+ var content = ContentLoader.Load(Statecraft.Game.Paths.Content);+ var map = OpenMap();+ foreach (var date in new[] { content.Rules.Start, new DateTime(1949, 4, 15), new DateTime(1951, 12, 15) })+ {+ var t = TownLandmarks.ShowAt(map, date, Array.Empty<Placement>(), content)!;+ CollectionAssert.DoesNotContain(asked.Select(a => a.id).ToList(), TownLandmarks.Jerusalem, "the first Jerusalem is never asked for");+ AnswerAll();+ Assert.AreEqual(TownLandmarks.Jerusalem3D, t.Placed.Single(p => p.Key == "jerusalem").Model, $"{date:d MMM yyyy}");+ Assert.IsTrue(t.Seats.ContainsKey("jerusalem"), "on its core");+ }+ }+/// <summary>The towns with a whole-town model, in the file's order.</summary>static List<Settlement> Mapped(MapScene map) => map.Settlements.Where(s => TownLandmarks.ModelFor(s) != null).ToList();diff --git a/unity/Assets/Tests/EditMode/UnitFiguresTests.cs b/unity/Assets/Tests/EditMode/UnitFiguresTests.csindex 5875c7b5a..9d174dff9 100644--- a/unity/Assets/Tests/EditMode/UnitFiguresTests.cs+++ b/unity/Assets/Tests/EditMode/UnitFiguresTests.cs@@ -29,12 +29,14 @@ public class UnitFiguresTestsstatic List<UnitEntry> Units => UnitData.Parse(File.ReadAllText(Path.Combine(Paths.Content, "map", UnitData.DefaultFileName)));static readonly DateTime May20 = new DateTime(1948, 5, 20), July12 = new DateTime(1948, 7, 12), LastArmistice = new DateTime(1949, 7, 20);- /// <summary>The nine unit models of #665.</summary>+ /// <summary>The nine unit models of #665, and #336's 1948 soldier (#708; owner, 21 October 2026: "a third figure on some+ /// brigade unit tokens, next to C06 and C07").</summary>static readonly string[] Nine ={"figure-c04-sabra-pioneer-v3", "figure-c05-pioneer-veteran-v2", "figure-c06-young-recruit-v2", "figure-c07-veteran-fighter-v2","figure-c12f-palmach-scout-v2", "figure-c08-arab-legion-v2", "figure-c09-irregular-v2","figure-vehicle-napoleonchik-65mm-1948-v2", "figure-vehicle-willys-jeep-1948-v2",+ "figure-soldier-1948-v1",};[SetUp] public void Fresh() { UnitFigures.Source = null; UnitFigures.Forget(); }@@ -130,10 +132,18 @@ public class UnitFiguresTests// By headgear, as #507 paired them: bush hat C04, steel helmet C06, stocking cap C07.CollectionAssert.AreEqual(new[] { UnitFigures.SabraPioneer, UnitFigures.YoungRecruit, UnitFigures.VeteranFighter },UnitData.Headgears.Select(h => UnitFigures.ByHeadgear[h]).ToArray());- // The uniform default's third figure is the pioneer veteran, Harel's the Palmach scout; Negev's headgear is sourced.+ // The uniform default's third figure is the pioneer veteran, Harel's the Palmach scout; Yiftach's and Negev's the 1948+ // soldier, in the Palmach's stocking cap, where Negev's sourced third cap is that cap (so its token is C07, C06 and him).CollectionAssert.AreEqual(new[] { UnitFigures.SabraPioneer, UnitFigures.YoungRecruit, UnitFigures.PioneerVeteran }, Trio("givati"));CollectionAssert.AreEqual(new[] { UnitFigures.SabraPioneer, UnitFigures.YoungRecruit, UnitFigures.PalmachScout }, Trio("harel"));- CollectionAssert.AreEqual(new[] { UnitFigures.VeteranFighter, UnitFigures.YoungRecruit, UnitFigures.VeteranFighter }, Trio("negev"));+ CollectionAssert.AreEqual(new[] { UnitFigures.SabraPioneer, UnitFigures.YoungRecruit, UnitFigures.Soldier1948 }, Trio("yiftach"));+ CollectionAssert.AreEqual(new[] { UnitFigures.VeteranFighter, UnitFigures.YoungRecruit, UnitFigures.Soldier1948 }, Trio("negev"));+ CollectionAssert.AreEqual(new[] { "harel", "negev", "yiftach" }, UnitFigures.ThirdFigure.Keys.OrderBy(k => k, StringComparer.Ordinal),+ "the three Palmach brigades (10th, 11th and 12th Brigade (Palmach), their rows' numbers)");+ foreach (var id in UnitFigures.ThirdFigure.Keys) StringAssert.EndsWith("(Palmach)", units[id].Number, id);+ // A third figure whose sourced cap is not the soldier's keeps its headgear's figure.+ var helmeted = new UnitEntry { Id = "negev", Side = UnitData.Israel, Headgear = new List<string> { UnitData.WoolCap, UnitData.SteelHelmet, UnitData.SteelHelmet } };+ Assert.AreEqual(UnitFigures.YoungRecruit, UnitFigures.FigureFor(helmeted, 2, UnitData.SteelHelmet), "a source's steel helmet is never swapped for his cap");CollectionAssert.AreEqual(Enumerable.Repeat(UnitFigures.ArabLegion, 3), Trio("arab_legion"));CollectionAssert.AreEqual(Enumerable.Repeat(UnitFigures.Irregular, 3), Trio("arab_liberation_army"));foreach (var side in UnitData.Sides.Where(s => s != UnitData.Israel && s != "jordan" && s != "ala"))@@ -194,7 +204,7 @@ public class UnitFiguresTestsCollectionAssert.AreEquivalent(new[] { "carmeli", "givati", "harel", "harel", "yiftach", "negev", "negev" }, vehicles.Select(v => v.parent.name),"the guns of the 11 July distribution and the Harel and Negev jeeps");Assert.IsTrue(asked.All(a => a.detail == CollectionDetail.Far), "the strategic-zoom mesh");- CollectionAssert.AreEquivalent(Nine, asked.Select(a => a.id), "each model once: the seven on the tokens, and the two forces' figures asked for ahead");+ CollectionAssert.AreEquivalent(Nine, asked.Select(a => a.id), "each model once: the eight on the tokens, and the two forces' figures asked for ahead");Assert.IsTrue(figures.All(f => !UnitFigures.Dressed(f) && f.GetComponent<MeshRenderer>().enabled), "the code-built figures until the models arrive");Assert.IsTrue(vehicles.All(v => v.childCount == 0 && v.GetComponentsInChildren<Renderer>().Length == 0), "no vehicle is drawn before it arrives");var before = figures.ToDictionary(f => f, f => (f.position, f.rotation));@@ -212,7 +222,10 @@ public class UnitFiguresTestsAssert.AreEqual(prefab.transform.localRotation, holder.GetChild(0).localRotation, $"{f.name}: the prefab keeps its own rotation (the FBX axis turn)");var b = ModelBox(f); float want = f.GetComponent<MeshFilter>().sharedMesh.bounds.size.y;Assert.AreEqual(want, b.size.y, 0.02f * want, $"{f.name}: as tall as the code-built figure");- Assert.Less(Mathf.Max(b.size.x, b.size.z), 0.55f * b.size.y, $"{f.name}: standing upright, arms down");+ // #336's soldier stands with his arms a little out from his sides (0.550 of his height across, measured):+ // still far from a T-pose, which is about as wide as it is tall.+ float arms = f.Find(UnitFigures.ModelName).GetChild(0).name.StartsWith(UnitFigures.Soldier1948, StringComparison.Ordinal) ? 0.56f : 0.55f;+ Assert.Less(Mathf.Max(b.size.x, b.size.z), arms * b.size.y, $"{f.name}: standing upright, arms down");Assert.AreEqual(0f, b.min.y, 0.01f, $"{f.name}: feet on the figure's origin");}foreach (var v in vehicles)