Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

content+unity: the GDD v0.2 must-have map locations, sourced and labelled in English and Hebrew (refs #1008) (#1057)

Eyal Golancff3d2ca26d5
diff --git a/ASSETS.yaml b/ASSETS.yaml
index f54e177f5..a8ab5792d 100644
--- a/ASSETS.yaml
+++ b/ASSETS.yaml
@@ -229,6 +229,11 @@ rules:
source: "The 1948 brigades, 101 Squadron and the first navy ships, with their dated positions (docs/units.md, Units in play): facts and place coordinates read from English and Hebrew Wikipedia (CC BY-SA; Wikipedia API prop=coordinates) and Wikidata (CC0), and the S-199 markings from Eduard Info 11/2025 pp. 53-54 (facts only, no text or image copied); per-row sources and check dates in the file"
status: verified
note: "Presentation only (the map's unit tokens); the sim never reads it, so the content hash does not move (UnitsInPlayTests). Rows marked wikipedia_only are drafts until checked against a published history (Lorch, The Edge of the Sword) or the IDF and Defense Establishment Archives. Owner, 17 Oct 2026 (#879, issuecomment-6233249635): 'Accept as draft for now'; ships labelled draft (the #570 rule, 'verify later'), with a scan check before 1.0."
+ - glob: "content/map/locations_1948.yaml"
+ licence: CC-BY-SA-4.0
+ source: "The GDD v0.2 must-have map locations (#1008, docs/locations.md): coordinates from each place's Wikidata item (CC0, property P625), names, identities and Hebrew names from English and Hebrew Wikipedia (CC BY-SA 4.0), Jerusalem's 15 May 1948 control from the Knesset's 'Liberation of Jerusalem' page and en.wiki Operation Pitchfork, Sha'ar HaAliyah's opening from R. D. Seidelman's BGU thesis abstract (facts only, no text copied beyond short quotes in comments); hexes from tools/hexgrid.py; per-row sources and check dates in the file"
+ status: verified
+ note: "Every row is status draft until a person checks each fact (CONTENT_POLICY section 2, rule 6); the Hebrew names are agent-checked (#564). The East Jerusalem / Old City starting control is sensitive and waits for the owner's review."
# --- Baked map textures (derived from the heightmap) ---
- glob: "unity/Assets/Textures/Map/landuse.png"
licence: CC-BY-SA-4.0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 669a7deae..70288587e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,13 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB
earns twice the job income, all labelled design values (Q-CRAFT-1 to Q-CRAFT-3). Each city's free jobs now fill on the
housing step at no Attention cost until an `AssignWorkers` order fixes that city's number (Q-JOBS-1). The reference
player stops sending `AssignWorkers`; only `scenario-mvp-absorb-first` moves (`,jobs=manual` on Tel Aviv).
+- The GDD v0.2 must-have map roster gains sourced records (`content/map/locations_1948.yaml`, all draft) for Negba,
+ Hulda, Nir Am, the Latrun and Iraq Suwaydan police forts, Bab al-Wad (Sha'ar HaGai), the Ad Halom bridge, Sha'ar
+ HaAliyah, and separate West and East Jerusalem / Old City markers. The loader validates their kinds, priorities,
+ explicit gameplay roles, sources, Hebrew names, land hexes and optional sourced control changes; the existing
+ `jerusalem` identity still owns the single Jerusalem city economy. East Jerusalem / the Old City is recorded as
+ Israeli-held from 15 May until its 28 May change to Arab forces. The map names each location in English and Hebrew,
+ and Jerusalem's pill reads "West Jerusalem" (#1008).
- Kiryat Shmona (founded 18 July 1949) and Beit Shemesh (15 December 1950, the National Library's December 1950
under the monthly turn) join the yishuv sites in `content/sites.yaml`, each with a field site in its hex; the
founding days are the owner's (#785), and the rows stay draft. The reference player builds them in id order, so
diff --git a/content/map/locations_1948.yaml b/content/map/locations_1948.yaml
new file mode 100644
index 000000000..08d3a26cc
--- /dev/null
+++ b/content/map/locations_1948.yaml
@@ -0,0 +1,227 @@
+# GDD v0.2 named map locations. Coordinates are sourced reference positions; q/r is authored by
+# tools/hexgrid.py settlement_hex. A marker is not, by itself, a managed city, designated site or
+# settlement-control target (docs/locations.md). Historical references are not unlock dates.
+locations:
+- id: negba
+ name: Negba
+ name_he: נגבה
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/נגבה', checked: 2026-10-18 }
+ kind: kibbutz
+ lon: 34.6830556
+ lat: 31.6608333
+ q: -7
+ r: 25
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this record is a map marker.
+ managed_city: false # DESIGN VALUE: map inclusion creates no city panel.
+ designated_site: false # DESIGN VALUE: this existing kibbutz is not a founding site.
+ settlement_control_target: false # DESIGN VALUE: map inclusion does not add a capture target.
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q1019154', checked: 2026-10-18 }
+ status: draft
+
+- id: hulda
+ name: Hulda
+ name_he: חולדה
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/חולדה_(קיבוץ)', checked: 2026-10-18 }
+ kind: kibbutz
+ lon: 34.8833333
+ lat: 31.8322222
+ q: -4
+ r: 23
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this record is a map marker.
+ managed_city: false # DESIGN VALUE: map inclusion creates no city panel.
+ designated_site: false # DESIGN VALUE: this existing kibbutz is not a founding site.
+ settlement_control_target: false # DESIGN VALUE: map inclusion does not add a capture target.
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q2916639', checked: 2026-10-18 }
+ status: draft
+
+- id: nir_am
+ name: Nir Am
+ name_he: ניר עם
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/ניר_עם', checked: 2026-10-18 }
+ kind: kibbutz
+ lon: 34.5808333
+ lat: 31.5194444
+ q: -9
+ r: 27
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this record is a map marker.
+ managed_city: false # DESIGN VALUE: map inclusion creates no city panel.
+ designated_site: false # DESIGN VALUE: this existing kibbutz is not a founding site.
+ settlement_control_target: false # DESIGN VALUE: map inclusion does not add a capture target.
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q2891278', checked: 2026-10-18 }
+ status: draft
+
+- id: latrun_fort
+ name: Latrun police fort
+ name_he: משטרת לטרון
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/משטרת_לטרון', checked: 2026-10-18 }
+ kind: fort
+ lon: 34.98036
+ lat: 31.8381
+ q: -2
+ r: 22
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this record is a map marker, not issue #707's 3D model.
+ managed_city: false # DESIGN VALUE: map inclusion creates no city panel.
+ designated_site: false # DESIGN VALUE: this fort is not a founding site.
+ settlement_control_target: false # DESIGN VALUE: map inclusion does not add a capture target.
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q16129570', checked: 2026-10-18 } # coordinates (P625) and identity: the Latrun Tegart fort
+ status: draft
+
+- id: iraq_suwaydan_fort
+ name: Iraq Suwaydan police fort
+ name_he: משטרת עיראק סווידאן
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/משטרת_עיראק_סווידאן', checked: 2026-10-18 }
+ kind: fort
+ lon: 34.6818194
+ lat: 31.6480118
+ q: -7
+ r: 25
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this record is a map marker.
+ managed_city: false # DESIGN VALUE: map inclusion creates no city panel.
+ designated_site: false # DESIGN VALUE: this fort is not a founding site.
+ settlement_control_target: false # DESIGN VALUE: map inclusion does not add a capture target.
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q97971283', checked: 2026-10-18 } # coordinates (P625): Fort Yoav, the Iraq Suwaydan police fort
+ - { url: 'https://en.wikipedia.org/wiki/Operation_Shmone', checked: 2026-10-18 } # identity: "the Egyptian-held police fort of Iraq Suwaydan"
+ status: draft
+
+- id: shaar_hagai
+ name: Bab al-Wad (Sha'ar HaGai)
+ name_he: באב אל-ואד (שער הגיא)
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/שער_הגיא', checked: 2026-10-18 }
+ kind: pass
+ lon: 35.024865
+ lat: 31.814508
+ q: -2
+ r: 23
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this record is a map marker.
+ managed_city: false # DESIGN VALUE: map inclusion creates no city panel.
+ designated_site: false # DESIGN VALUE: this pass is not a founding site.
+ settlement_control_target: false # DESIGN VALUE: map inclusion does not add a capture target.
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q1282220', checked: 2026-10-18 } # coordinates (P625)
+ - { url: "https://en.wikipedia.org/wiki/Sha'ar_HaGai", checked: 2026-10-18 } # the name: Bab al-Wad, used in Hebrew as well in 1948
+ status: draft
+
+- id: ad_halom_bridge
+ name: Jisr Isdud (Ad Halom bridge)
+ name_he: גשר עד הלום
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/גשר_עד_הלום', checked: 2026-10-18 }
+ kind: bridge
+ lon: 34.6694067
+ lat: 31.7820937
+ q: -6
+ r: 23
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this record is a map marker, separate from nearby Isdud.
+ managed_city: false # DESIGN VALUE: map inclusion creates no city panel.
+ designated_site: false # DESIGN VALUE: this bridge is not a founding site.
+ settlement_control_target: false # DESIGN VALUE: map inclusion does not add a capture target.
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q124414245', checked: 2026-10-18 } # coordinates (P625); en.wiki Jisr Isdud: "also known as the Ad Halom Bridge"
+ - { url: 'https://en.wikipedia.org/wiki/Jisr_Isdud', checked: 2026-10-18 }
+ status: draft
+
+- id: shaar_haaliyah
+ name: Sha'ar HaAliyah
+ name_he: שער העלייה
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/שער_העלייה', checked: 2026-10-18 }
+ kind: reception_camp
+ lon: 34.95745
+ lat: 32.8160806
+ q: 5
+ r: 8
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this record is a map marker.
+ managed_city: false # DESIGN VALUE: map inclusion creates no city panel.
+ designated_site: false # DESIGN VALUE: this reception camp is not a yishuv founding site.
+ settlement_control_target: false # DESIGN VALUE: map inclusion does not add a capture target.
+ historical_reference: March 1949
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q10395086', checked: 2026-10-18 } # coordinates (P625)
+ - { url: 'https://www.bgu.ac.il/media/gedf3fo2/bguphd2009.pdf', checked: 2026-10-18 } # Seidelman, abstract: "opened in March, 1949 on the Haifa coast"
+ status: draft
+
+# `jerusalem` deliberately reuses the existing settlement and cities.yaml identity. Its map name is the western
+# half; the one city economy remains keyed by `jerusalem`.
+- id: jerusalem
+ name: West Jerusalem
+ name_he: מערב ירושלים
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/מערב_ירושלים', checked: 2026-10-18 }
+ kind: city
+ lon: 35.2194444
+ lat: 31.7819444
+ q: 0
+ r: 23
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this record is a map marker.
+ managed_city: true # DESIGN VALUE: reuse the existing Jerusalem city economy.
+ designated_site: false # DESIGN VALUE: Jerusalem is not a founding site.
+ settlement_control_target: false # DESIGN VALUE: the roster does not select capture targets.
+ starting_control: israeli
+ control_date: 1948-05-15
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q2213440', checked: 2026-10-18 } # coordinates (P625)
+ # starting_control: on 14 May 1948, as the British left, "the Israeli forces began to take over compounds held by the
+ # Mandatory government" (Knesset); Operation Pitchfork (13-18 May) captured "the Jewish suburbs of Jerusalem" (en.wiki).
+ - { url: 'https://m.knesset.gov.il/En/About/Documents/JerEnPDF1.pdf', checked: 2026-10-18 }
+ - { url: 'https://en.wikipedia.org/wiki/Operation_Pitchfork', checked: 2026-10-18 }
+ status: draft
+
+- id: east_jerusalem_old_city
+ name: East Jerusalem / Old City
+ name_he: מזרח ירושלים / העיר העתיקה
+ name_he_review: agent-checked
+ name_he_sources:
+ - { url: 'https://he.wikipedia.org/wiki/מזרח_ירושלים', checked: 2026-10-18 }
+ - { url: 'https://he.wikipedia.org/wiki/העיר_העתיקה', checked: 2026-10-18 }
+ kind: city
+ lon: 35.2341667
+ lat: 31.7766667
+ q: 0
+ r: 23
+ priority: must_have # DESIGN VALUE: owner-approved GDD v0.2 map priority, 17 October 2026.
+ marker: true # DESIGN VALUE: this is a second map marker, not a second city economy.
+ managed_city: false # DESIGN VALUE: cities.yaml keeps one Jerusalem economy.
+ designated_site: false # DESIGN VALUE: the Old City is not a founding site.
+ settlement_control_target: false # DESIGN VALUE: the roster does not select capture targets.
+ starting_control: israeli
+ control_date: 1948-05-15
+ control_change:
+ date: 1948-05-28
+ control: arab_forces
+ sources:
+ - { url: 'https://m.knesset.gov.il/En/About/Documents/JerEnPDF1.pdf', checked: 2026-10-18 }
+ sources:
+ - { url: 'https://www.wikidata.org/wiki/Q213274', checked: 2026-10-18 } # coordinates (P625): the Old City
+ # starting_control and control_change (SENSITIVE, owner ruling, 18 October 2026): Israeli-held until 28 May 1948;
+ # the Knesset's "Liberation of Jerusalem" records that the Jewish Quarter fell to the Jordanians on that date.
+ - { url: 'https://m.knesset.gov.il/En/About/Documents/JerEnPDF1.pdf', checked: 2026-10-18 }
+ status: draft
diff --git a/sim/Statecraft.Sim.Tests/Fixture.cs b/sim/Statecraft.Sim.Tests/Fixture.cs
index 88900636b..1faec5a2a 100644
--- a/sim/Statecraft.Sim.Tests/Fixture.cs
+++ b/sim/Statecraft.Sim.Tests/Fixture.cs
@@ -187,6 +187,25 @@ settlements:
["map/settlements_1948.yaml"] = @"
settlements:
- { id: town_a, name: Town A, lon: 34.29, lat: 33.35, type: town, founded: 1900, pre_modern: false }
+",
+ ["map/locations_1948.yaml"] = @"
+locations:
+ - id: town_a
+ name: Town A
+ name_he: עיר א
+ name_he_sources: [{ url: 'https://example.org/town-a-he', checked: 2026-10-18 }]
+ kind: city
+ lon: 34.29
+ lat: 33.35
+ q: 1
+ r: 0
+ priority: must_have
+ marker: true
+ managed_city: true
+ designated_site: false
+ settlement_control_target: false
+ sources: [{ url: 'https://example.org/town-a', checked: 2026-10-18 }]
+ status: draft
",
["aliyah.yaml"] = @"
regions:
diff --git a/sim/Statecraft.Sim.Tests/MapContentTests.cs b/sim/Statecraft.Sim.Tests/MapContentTests.cs
index 47dece19c..658f4c5a5 100644
--- a/sim/Statecraft.Sim.Tests/MapContentTests.cs
+++ b/sim/Statecraft.Sim.Tests/MapContentTests.cs
@@ -14,6 +14,73 @@ public class MapContentTests
Assert.Equal("hills", c.HexAt(2, 1)!.Biome);
Assert.Null(c.HexAt(9, 9));
Assert.Equal(("town_a", 1, 0), (c.SettlementHexes[0].Id, c.SettlementHexes[0].Q, c.SettlementHexes[0].R));
+ Assert.Equal(("town_a", "city", "must_have"), (c.MapLocations[0].Id, c.MapLocations[0].Kind, c.MapLocations[0].Priority));
+ }
+
+ [Theory]
+ [InlineData("kind: city", "kind: citty", "locations[town_a].kind", "unknown kind")]
+ [InlineData("priority: must_have", "priority: urgent", "locations[town_a].priority", "unknown priority")]
+ [InlineData(" name_he: עיר א\n", "", "locations[town_a].name_he", "required")]
+ [InlineData(" name_he_sources: [{ url: 'https://example.org/town-a-he', checked: 2026-10-18 }]\n", "", "locations[town_a].name_he_sources", "needs a source")]
+ [InlineData(" name_he: עיר א\n", " name_he: עיר א\n name_he_review: checked\n", "locations[town_a].name_he_review", "not agent-checked")]
+ [InlineData("q: 1", "q: 9", "locations[town_a].q", "not a land hex")]
+ [InlineData(" sources: [{ url: 'https://example.org/town-a', checked: 2026-10-18 }]\n", "", "locations[town_a].sources", "required")]
+ [InlineData(" status: draft", " starting_control: arab_forces\n status: draft", "locations[town_a].control_date", "required with starting_control")]
+ public void AMapLocationRecordIsValidated(string before, string after, string field, string message)
+ {
+ var bad = Fixture.Files["map/locations_1948.yaml"].Replace(before, after);
+ var ex = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(new Dictionary<string, string> { ["map/locations_1948.yaml"] = bad })));
+ Assert.Equal("map/locations_1948.yaml", ex.File);
+ Assert.Equal(field, ex.Field);
+ Assert.Contains(message, ex.Message);
+ }
+
+ [Fact]
+ public void AMapLocationControlChangeLoads()
+ {
+ var yaml = Fixture.Files["map/locations_1948.yaml"].Replace(
+ " sources: [{ url: 'https://example.org/town-a', checked: 2026-10-18 }]",
+ " starting_control: israeli\n control_date: 1948-05-15\n control_change: { date: 1948-05-28, control: arab_forces, sources: [{ url: 'https://example.org/control', checked: 2026-10-18 }] }\n sources: [{ url: 'https://example.org/town-a', checked: 2026-10-18 }]");
+
+ var location = Assert.Single(ContentLoader.Load(Fixture.Write(new Dictionary<string, string>
+ { ["map/locations_1948.yaml"] = yaml })).MapLocations);
+
+ Assert.Equal(new System.DateTime(1948, 5, 28), location.ControlChange!.Date);
+ Assert.Equal("arab_forces", location.ControlChange.Control);
+ Assert.Equal("https://example.org/control", Assert.Single(location.ControlChange.Sources).Url);
+ }
+
+ [Theory]
+ [InlineData("1948-05-14", "arab_forces", "[{ url: 'https://example.org/control', checked: 2026-10-18 }]", "date", "must be after control_date")]
+ [InlineData("1948-05-28", "foreign_army", "[{ url: 'https://example.org/control', checked: 2026-10-18 }]", "control", "unknown control")]
+ [InlineData("1948-05-28", "arab_forces", "[]", "sources", "required")]
+ [InlineData("1948-05-28", "arab_forces", "[{ url: 'http://example.org/control', checked: 2026-10-18 }]", "sources[0]", "needs an https url and a checked date")]
+ public void AnInvalidMapLocationControlChangeIsALoadError(string date, string control, string sources, string field, string message)
+ {
+ var yaml = Fixture.Files["map/locations_1948.yaml"].Replace(
+ " sources: [{ url: 'https://example.org/town-a', checked: 2026-10-18 }]",
+ $" starting_control: israeli\n control_date: 1948-05-15\n control_change: {{ date: {date}, control: {control}, sources: {sources} }}\n sources: [{{ url: 'https://example.org/town-a', checked: 2026-10-18 }}]");
+
+ var ex = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(new Dictionary<string, string>
+ { ["map/locations_1948.yaml"] = yaml })));
+
+ Assert.Equal("map/locations_1948.yaml", ex.File);
+ Assert.Equal($"locations[town_a].control_change.{field}", ex.Field);
+ Assert.Contains(message, ex.Message);
+ }
+
+ [Fact]
+ public void AMapLocationControlChangeWithoutAControlDateIsALoadError()
+ {
+ var yaml = Fixture.Files["map/locations_1948.yaml"].Replace(
+ " sources: [{ url: 'https://example.org/town-a', checked: 2026-10-18 }]",
+ " control_change: { date: 1948-05-28, control: arab_forces, sources: [{ url: 'https://example.org/control', checked: 2026-10-18 }] }\n sources: [{ url: 'https://example.org/town-a', checked: 2026-10-18 }]");
+
+ var ex = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(new Dictionary<string, string>
+ { ["map/locations_1948.yaml"] = yaml })));
+
+ Assert.Equal("locations[town_a].control_change.date", ex.Field);
+ Assert.Contains("requires control_date", ex.Message);
}
[Fact]
@@ -91,6 +158,12 @@ public class MapContentTests
Assert.Equal(1102, c.Hexes.Count);
Assert.Equal(870, c.Hexes.Count(h => h.Land));
Assert.Equal(25, c.SettlementHexes.Count);
+ Assert.Equal(10, c.MapLocations.Count);
Assert.Contains(c.SettlementHexes, s => s.Id == "tiberias");
+ Assert.Contains(c.MapLocations, x => x.Id == "jerusalem" && x.Name == "West Jerusalem" && x.StartingControl == "israeli");
+ var eastJerusalem = Assert.Single(c.MapLocations, x => x.Id == "east_jerusalem_old_city");
+ Assert.Equal("israeli", eastJerusalem.StartingControl);
+ Assert.Equal(new System.DateTime(1948, 5, 28), eastJerusalem.ControlChange!.Date);
+ Assert.Equal("arab_forces", eastJerusalem.ControlChange.Control);
}
}
diff --git a/sim/Statecraft.Sim/Content.cs b/sim/Statecraft.Sim/Content.cs
index e4aea3afb..d4b3864a9 100644
--- a/sim/Statecraft.Sim/Content.cs
+++ b/sim/Statecraft.Sim/Content.cs
@@ -9,6 +9,46 @@ namespace Statecraft.Sim
public sealed class Source { public string Url { get; set; } = ""; public DateTime Checked { get; set; } }
+ public sealed class MapLocationControlChange
+ {
+ public DateTime Date { get; set; }
+ public string Control { get; set; } = "";
+ public List<Source> Sources { get; set; } = new List<Source>();
+ }
+
+ /// <summary>A named place on the GDD v0.2 map roster. This is map metadata, not a city, capture target or build site;
+ /// those roles are explicit booleans so map inclusion cannot silently grant gameplay behavior.</summary>
+ public sealed class MapLocation
+ {
+ public string Id { get; set; } = "";
+ /// <summary>The period-appropriate display name.</summary>
+ public string Name { get; set; } = "";
+ /// <summary>The Hebrew display name the Hebrew UI's map label shows, with its own sources (as settlements_1948.yaml's name_he).</summary>
+ public string NameHe { get; set; } = "";
+ /// <summary>"agent-checked" while no person has read the Hebrew name (CONTENT_POLICY section 2, rule 6); empty once reviewed.</summary>
+ public string NameHeReview { get; set; } = "";
+ public List<Source> NameHeSources { get; set; } = new List<Source>();
+ public string Kind { get; set; } = "";
+ public double Lon { get; set; }
+ public double Lat { get; set; }
+ public int Q { get; set; }
+ public int R { get; set; }
+ public string Priority { get; set; } = "";
+ public bool Marker { get; set; }
+ public bool ManagedCity { get; set; }
+ public bool DesignatedSite { get; set; }
+ public bool SettlementControlTarget { get; set; }
+ /// <summary>Optional sourced holder at the campaign start. Empty where this issue does not establish one.</summary>
+ public string StartingControl { get; set; } = "";
+ public DateTime ControlDate { get; set; }
+ /// <summary>An optional sourced later historical control, recorded as metadata only.</summary>
+ public MapLocationControlChange? ControlChange { get; set; }
+ /// <summary>An optional sourced historical reference, never an availability or unlock rule.</summary>
+ public string HistoricalReference { get; set; } = "";
+ public List<Source> Sources { get; set; } = new List<Source>();
+ public string Status { get; set; } = "";
+ }
+
/// <summary>The shape of a sign-off's `reviewed_by`: a GitHub handle (letters and digits, single hyphens between them,
/// at most 39 characters, and at least one letter, so a bare number such as 1234 reads the same in every reader), so never an email, an @-name, a display name or a bot account ("name[bot]"). Shared with
/// the map's readers in Unity.</summary>
@@ -1040,6 +1080,8 @@ namespace Statecraft.Sim
}
}
public List<SettlementHex> SettlementHexes = new List<SettlementHex>();
+ /// <summary>Named GDD map locations. Presentation metadata only; gameplay roles remain in their owning systems.</summary>
+ public List<MapLocation> MapLocations = new List<MapLocation>();
/// <summary>The display name of each settlement id (map/settlements_1948.yaml name), for text the player reads.</summary>
public Dictionary<string, string> SettlementNames = new Dictionary<string, string>();
/// <summary>The GDD cities' start values (cities.yaml), in file order. Empty in the legacy loop.</summary>
diff --git a/sim/Statecraft.Sim/ContentLoader.cs b/sim/Statecraft.Sim/ContentLoader.cs
index 1a7568b81..4852c4bb3 100644
--- a/sim/Statecraft.Sim/ContentLoader.cs
+++ b/sim/Statecraft.Sim/ContentLoader.cs
@@ -45,6 +45,7 @@ namespace Statecraft.Sim
public List<MapHex> Hexes { get; set; } = new List<MapHex>();
}
sealed class SettlementHexesFile { public List<SettlementHex> Settlements { get; set; } = new List<SettlementHex>(); }
+ sealed class MapLocationsFile { public List<MapLocation> Locations { get; set; } = new List<MapLocation>(); }
sealed class CitiesFile { public List<CityStart> Cities { get; set; } = new List<CityStart>(); }
sealed class UnitTypesFile { public List<UnitType> Types { get; set; } = new List<UnitType>(); }
sealed class SitesFile { public List<Site> Sites { get; set; } = new List<Site>(); }
@@ -54,6 +55,7 @@ namespace Statecraft.Sim
public const string HexesFile = "map/hexes.json";
public const string SettlementHexesFileName = "map/settlement_hexes.yaml";
public const string SettlementsFileName = "map/settlements_1948.yaml";
+ public const string MapLocationsFileName = "map/locations_1948.yaml";
/// <summary>The ids and names of settlements_1948.yaml, which the tools own (its other keys are not the sim's business),
/// so it is read as plain maps rather than through the strict content types.</summary>
@@ -319,6 +321,7 @@ namespace Statecraft.Sim
c.PopulationAnchors = Read<PopulationFile>(readFile, "population.yaml").Anchors;
c.Hexes = Read<MapFile>(readFile, HexesFile).Hexes;
c.SettlementHexes = Read<SettlementHexesFile>(readFile, SettlementHexesFileName).Settlements;
+ c.MapLocations = Read<MapLocationsFile>(readFile, MapLocationsFileName).Locations;
var settlements = ReadSettlements(readFile);
var settlementIds = settlements.Select(x => x.id).ToList();
foreach (var (id, name) in settlements) c.SettlementNames[id] = name; // a duplicate id fails in ValidateMap
@@ -934,6 +937,7 @@ namespace Statecraft.Sim
if (a.Date == default) throw new ContentException("population.yaml", path + ".date", "required");
Count("population.yaml", path + ".jews", a.Jews);
}
+ ValidateMapLocations(c, settlementIds);
ValidateMap(c, settlementIds);
ValidateWindows(c);
EventRules.Validate(c, offices, indicators);
@@ -1304,6 +1308,72 @@ namespace Statecraft.Sim
}
}
+ static readonly string[] MapLocationKinds = { "city", "kibbutz", "fort", "pass", "bridge", "reception_camp" };
+ static readonly string[] MapLocationPriorities = { "must_have", "optional" };
+ static readonly string[] StartingControls = { "israeli", "arab_forces", "contested" };
+
+ /// <summary>GDD v0.2 named map locations: sourced metadata on a land hex. A location's explicit role flags keep this
+ /// roster from creating a managed city, designated site or settlement-control target by implication.</summary>
+ static void ValidateMapLocations(Content c, List<string> settlementIds)
+ {
+ const string lf = MapLocationsFileName;
+ Unique(lf, "locations", c.MapLocations.Select(x => x.Id));
+ var settlements = new HashSet<string>(settlementIds);
+ foreach (var x in c.MapLocations)
+ {
+ var at = $"locations[{x.Id}]";
+ Named(lf, at + ".name", x.Name);
+ Named(lf, at + ".name_he", x.NameHe); // the map labels it in both languages (#1008)
+ if (x.NameHeReview != "" && x.NameHeReview != "agent-checked")
+ throw new ContentException(lf, at + ".name_he_review", $"'{x.NameHeReview}' is not agent-checked (delete the line once a person has reviewed the name)");
+ if (x.NameHeSources.Count == 0) throw new ContentException(lf, at + ".name_he_sources", "required: a Hebrew name needs a source");
+ for (int i = 0; i < x.NameHeSources.Count; i++)
+ if (x.NameHeSources[i] == null || !x.NameHeSources[i].Url.StartsWith("https://", StringComparison.Ordinal) || x.NameHeSources[i].Checked == default)
+ throw new ContentException(lf, FormattableString.Invariant($"{at}.name_he_sources[{i}]"), "needs a url and checked date");
+ if (!MapLocationKinds.Contains(x.Kind))
+ throw new ContentException(lf, at + ".kind", $"unknown kind '{x.Kind}' ({string.Join(", ", MapLocationKinds)})");
+ if (!MapLocationPriorities.Contains(x.Priority))
+ throw new ContentException(lf, at + ".priority", $"unknown priority '{x.Priority}' ({string.Join(", ", MapLocationPriorities)})");
+ Finite(lf, at + ".lon", x.Lon);
+ Finite(lf, at + ".lat", x.Lat);
+ if (x.Lon < -180 || x.Lon > 180) throw new ContentException(lf, at + ".lon", "must be from -180 to 180");
+ if (x.Lat < -90 || x.Lat > 90) throw new ContentException(lf, at + ".lat", "must be from -90 to 90");
+ var hex = c.HexAt(x.Q, x.R);
+ if (hex == null || !hex.Land)
+ throw new ContentException(lf, at + ".q", FormattableString.Invariant($"hex q={x.Q} r={x.R} is not a land hex in {HexesFile}"));
+ if (!x.Marker) throw new ContentException(lf, at + ".marker", "must be true: this file is the map-location roster");
+ if (x.ManagedCity && !settlements.Contains(x.Id))
+ throw new ContentException(lf, at + ".managed_city", $"needs the same id in {SettlementsFileName}");
+ if (x.StartingControl == "" && x.ControlDate != default)
+ throw new ContentException(lf, at + ".starting_control", "required with control_date");
+ if (x.StartingControl != "")
+ {
+ if (!StartingControls.Contains(x.StartingControl))
+ throw new ContentException(lf, at + ".starting_control", $"unknown control '{x.StartingControl}' ({string.Join(", ", StartingControls)})");
+ if (x.ControlDate == default) throw new ContentException(lf, at + ".control_date", "required with starting_control");
+ }
+ if (x.ControlChange != null)
+ {
+ var change = x.ControlChange;
+ var cat = at + ".control_change";
+ if (x.ControlDate == default) throw new ContentException(lf, cat + ".date", "requires control_date");
+ if (change.Date <= x.ControlDate) throw new ContentException(lf, cat + ".date", "must be after control_date");
+ if (!StartingControls.Contains(change.Control))
+ throw new ContentException(lf, cat + ".control", $"unknown control '{change.Control}' ({string.Join(", ", StartingControls)})");
+ if (change.Sources == null || change.Sources.Count == 0)
+ throw new ContentException(lf, cat + ".sources", "required: a control change is a historical fact");
+ for (int i = 0; i < change.Sources.Count; i++)
+ if (change.Sources[i] == null || !change.Sources[i].Url.StartsWith("https://", StringComparison.Ordinal) || change.Sources[i].Checked == default)
+ throw new ContentException(lf, FormattableString.Invariant($"{cat}.sources[{i}]"), "needs an https url and a checked date");
+ }
+ if (x.Sources.Count == 0) throw new ContentException(lf, at + ".sources", "required: a map location is a historical fact");
+ for (int i = 0; i < x.Sources.Count; i++)
+ if (x.Sources[i] == null || !x.Sources[i].Url.StartsWith("https://", StringComparison.Ordinal) || x.Sources[i].Checked == default)
+ throw new ContentException(lf, FormattableString.Invariant($"{at}.sources[{i}]"), "needs a url and checked date");
+ Status(lf, at + ".status", x.Status);
+ }
+ }
+
static void ValidateMap(Content c, List<string> settlementIds)
{
if (c.Hexes.Count == 0) throw new ContentException(HexesFile, "hexes", "no hexes");
diff --git a/tools/tests/test_locations.py b/tools/tests/test_locations.py
new file mode 100644
index 000000000..e1bf6e6ee
--- /dev/null
+++ b/tools/tests/test_locations.py
@@ -0,0 +1,30 @@
+"""Checks GDD v0.2 map locations against the authored hex grid."""
+import json
+from pathlib import Path
+
+import yaml12
+
+import hexgrid as hg
+
+
+ROOT = Path(__file__).resolve().parents[2]
+MAP = ROOT / "content" / "map"
+HEXES = json.loads((MAP / "hexes.json").read_text())
+LOCATIONS = yaml12.load((MAP / "locations_1948.yaml").read_text())["locations"]
+
+
+def test_sourced_coordinates_bind_to_the_authored_hexes():
+ for location in LOCATIONS:
+ assert hg.settlement_hex(location["lon"], location["lat"], HEXES) == (location["q"], location["r"]), location["id"]
+
+
+def test_issue_1008_roster_and_separate_adjacent_positions():
+ by_id = {location["id"]: location for location in LOCATIONS}
+ assert set(by_id) == {
+ "negba", "hulda", "nir_am", "latrun_fort", "iraq_suwaydan_fort", "shaar_hagai",
+ "ad_halom_bridge", "shaar_haaliyah", "jerusalem", "east_jerusalem_old_city",
+ }
+ assert by_id["iraq_suwaydan_fort"]["id"] != "negba"
+ assert by_id["ad_halom_bridge"]["id"] != "isdud"
+ assert by_id["jerusalem"]["managed_city"] is True
+ assert by_id["east_jerusalem_old_city"]["managed_city"] is False
diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.cs
index 435f2ac3e..fd49a2c7f 100644
--- a/unity/Assets/Scripts/UI/GameRoot.cs
+++ b/unity/Assets/Scripts/UI/GameRoot.cs
@@ -323,7 +323,7 @@ namespace Statecraft.Game.UI
// Issue #710: the static 1948 tier from cities.yaml's people, not the sim's live count (owner, 15 October 2026).
bridge.Content.Cities.Where(c => c.People != null).ToDictionary(c => c.Id, c => c.People!.Value),
(tier, people) => text.Format("map.tier", tier, MapLabelsPresenter.TierCount, people.ToString("N0", CultureInfo.InvariantCulture)),
- hebrew));
+ hebrew, bridge.Content.MapLocations)); // #1008: the GDD v0.2 map locations are named too
mini.Clicked += (lon, lat) => { camRig.LookAt = map.Frame.ToWorld(lon, lat, 0); cameraController.Settle(); SyncMinimap(); labels?.Refresh(); }; // the click may come after LateUpdate (review M6)
// The minimap's whole-map button: the camera's own farthest zoom, over the middle of the map (no new rule).
mini.Overview += () =>
diff --git a/unity/Assets/Scripts/UI/MapLabelsPresenter.cs b/unity/Assets/Scripts/UI/MapLabelsPresenter.cs
index 8737cb38f..d303500e1 100644
--- a/unity/Assets/Scripts/UI/MapLabelsPresenter.cs
+++ b/unity/Assets/Scripts/UI/MapLabelsPresenter.cs
@@ -59,7 +59,14 @@ namespace Statecraft.Game.UI
/// The 1948 localities (MapScene.Localities, owner rulings 2026-10-11) get smaller pills with their 1948 names, placed
/// after every game settlement by the same rules and only nearer than LocalityDistanceM (farther out they are skipped
/// outright, so the overview pays nothing for them); Hover shows today's name in a tooltip under the pill the pointer
- /// is over.</summary>
+ /// is over.
+ ///
+ /// The GDD v0.2 map locations (#1008, content/map/locations_1948.yaml through the sim's Content.MapLocations) are named
+ /// too. A location that reuses a game settlement's id renames that settlement's pill (Jerusalem's reads "West
+ /// Jerusalem"); each other location gets its own pill after the game settlements and before the built sites and the
+ /// localities, placed by the same rules against a marker box at its sourced point (LabelType: a kibbutz's, a city's,
+ /// or a village's for a fort, pass, bridge or reception camp). Two locations in one hex (Negba and the Iraq Suwaydan
+ /// fort; Jerusalem and the Old City) are two pills, and the own-marker rule keeps them apart.</summary>
public sealed class MapLabelsPresenter : IDisposable
{
public const string ContainerName = "map-labels", SlotClass = "map-label-slot", LabelClass = "map-label";
@@ -135,6 +142,15 @@ namespace Statecraft.Game.UI
/// <summary>The 1948 localities' pills (smaller, named only within LocalityDistanceM), in localities_1948.yaml order.</summary>
public IReadOnlyList<Label> LocalityLabels { get; }
public IReadOnlyList<VisualElement> LocalitySlots { get; }
+ /// <summary>The map locations' own pills (#1008), in locations_1948.yaml order; a location that renames a game
+ /// settlement's pill has none here.</summary>
+ public IReadOnlyList<Label> LocationLabels { get; }
+ public IReadOnlyList<VisualElement> LocationSlots { get; }
+ public const string LocationClass = "map-label-location";
+
+ /// <summary>The settlement type whose marker size, pill style and declutter a map location's pill borrows (#1008):
+ /// a city's or a kibbutz's for those kinds, a village's (a minor place) for a fort, pass, bridge or reception camp.</summary>
+ public static string LabelType(string kind) => kind == "city" || kind == "kibbutz" ? kind : "village";
/// <summary>The tooltip of the locality whose pill the pointer is over: today's name where a living place carries on
/// ("Today: Beit She'an" under "Beisan"; owner ruling 2026-10-12: none for a place that did not), "Mixed locality" for
/// Nesher; hidden otherwise, and never for a pill with nothing to say. Ignores the pointer, like the pills.</summary>
@@ -171,7 +187,7 @@ namespace Statecraft.Game.UI
public MapLabelsPresenter(VisualElement root, MapScene map, Camera camera, Func<float>? zoomDistance = null, Func<Statecraft.Game.Map.Kits.Localities.Place, string?>? tipText = null,
Func<IReadOnlyList<Bounds[]>?>? keepClear = null, IReadOnlyDictionary<string, decimal>? population = null,
- Func<int, decimal, string>? tierTip = null, bool hebrew = false)
+ Func<int, decimal, string>? tierTip = null, bool hebrew = false, IReadOnlyList<Statecraft.Sim.MapLocation>? locations = null)
{
var tip = tipText ?? DefaultTip;
this.keepClear = keepClear;
@@ -189,6 +205,9 @@ namespace Statecraft.Game.UI
var anchorClass = AnchorClass.TryGetValue(s.Id, out var a) ? a : Centre;
// #880: the Hebrew UI shows the row's name_he, and the English name where the row has none.
var label = new Label(hebrew && !string.IsNullOrWhiteSpace(s.NameHe) ? s.NameHe : s.Name) { name = "label-" + s.Id, pickingMode = PickingMode.Ignore };
+ // #1008: a map location with this settlement's id names it (Jerusalem's pill reads "West Jerusalem").
+ var renamed = FindLocation(locations, s.Id);
+ if (renamed != null) label.text = LocationName(renamed, hebrew);
label.AddToClassList(LabelClass);
label.AddToClassList("map-label-" + s.Type);
label.AddToClassList(anchorClass);
@@ -226,6 +245,27 @@ namespace Statecraft.Game.UI
for (int p = 0; p <= 2; p++)
foreach (var it in settlementOrder) if (Priority(it.Settlement.Type) == p) items.Add(it);
Labels = labels; Slots = slots;
+ // #1008: the map locations that are no game settlement, after the settlements and before the sites and localities.
+ var locationLabels = new List<Label>(); var locationSlots = new List<VisualElement>();
+ var settlementIds = new HashSet<string>();
+ foreach (var s in map.Settlements) settlementIds.Add(s.Id);
+ if (locations != null)
+ foreach (var loc in locations)
+ {
+ if (settlementIds.Contains(loc.Id)) continue;
+ var s = new Settlement { Id = loc.Id, Name = loc.Name, NameHe = loc.NameHe, Type = LabelType(loc.Kind), Lon = loc.Lon, Lat = loc.Lat };
+ var slot = new VisualElement { name = "slot-" + s.Id, pickingMode = PickingMode.Ignore };
+ slot.AddToClassList(SlotClass);
+ var label = new Label(LocationName(loc, hebrew)) { name = "label-" + s.Id, pickingMode = PickingMode.Ignore };
+ label.AddToClassList(LabelClass); label.AddToClassList("map-label-" + s.Type); label.AddToClassList(LocationClass); label.AddToClassList(Centre);
+ slot.Add(label);
+ container.Add(slot);
+ locationLabels.Add(label); locationSlots.Add(slot);
+ var top = MarkerTop(map, s);
+ var it = new Item { Settlement = s, MarkerTop = top, Kit = KitBounds(map, s, top), Marker = MarkerBox(s, top), Slot = slot, Label = label, IsCity = s.Type == "city", First = Spot.AboveCentre };
+ settlementOrder.Add(it); items.Add(it);
+ }
+ LocationLabels = locationLabels; LocationSlots = locationSlots;
// The 1948 localities after every game settlement, largest first (the file's order): presentation only.
var localityLabels = new List<Label>(); var localitySlots = new List<VisualElement>();
foreach (var place in map.Localities)
@@ -267,6 +307,15 @@ namespace Statecraft.Game.UI
Refresh(force: true);
}
+ static Statecraft.Sim.MapLocation? FindLocation(IReadOnlyList<Statecraft.Sim.MapLocation>? locations, string id)
+ {
+ if (locations != null) foreach (var l in locations) if (l.Id == id) return l;
+ return null;
+ }
+
+ /// <summary>A map location's pill text: its Hebrew name in the Hebrew UI (the English where it has none), else its name.</summary>
+ public static string LocationName(Statecraft.Sim.MapLocation l, bool hebrew) => hebrew && !string.IsNullOrWhiteSpace(l.NameHe) ? l.NameHe : l.Name;
+
/// <summary>The top of a settlement's marker box: the point a pill over its kit hangs from, and the point that says
/// whether the place is on screen.</summary>
public static Vector3 MarkerTop(MapScene map, Settlement s)
@@ -637,6 +686,7 @@ namespace Statecraft.Game.UI
occluders.Clear();
foreach (var slot in Slots) slot.RemoveFromHierarchy();
foreach (var slot in LocalitySlots) slot.RemoveFromHierarchy();
+ foreach (var slot in LocationSlots) slot.RemoveFromHierarchy();
foreach (var it in siteItems) it.Slot.RemoveFromHierarchy();
siteItems.Clear();
Tooltip.RemoveFromHierarchy();
diff --git a/unity/Assets/Tests/EditMode/HebrewUiTests.cs b/unity/Assets/Tests/EditMode/HebrewUiTests.cs
index 2ae78e803..55a30853e 100644
--- a/unity/Assets/Tests/EditMode/HebrewUiTests.cs
+++ b/unity/Assets/Tests/EditMode/HebrewUiTests.cs
@@ -300,7 +300,9 @@ public class HebrewUiTests
}
/// <summary>#880: in Hebrew every map name pill shows its row's name_he, and its English name where the row has none (a
- /// 1948 locality such as Na'ana); an English restart puts the English names back.</summary>
+ /// 1948 locality such as Na'ana); an English restart puts the English names back. #1008: a GDD v0.2 map location
+ /// (content/map/locations_1948.yaml) is named in both languages too, and the one with a settlement's id (jerusalem)
+ /// names that settlement's pill: "מערב ירושלים", "West Jerusalem".</summary>
[Test]
public void InHebrewEachMapPillShowsItsHebrewNameWhereTheRowHasOne()
{
@@ -315,15 +317,20 @@ public class HebrewUiTests
Assert.AreEqual("תל אביב", Ui.Q<Label>("label-tel_aviv").text);
Assert.AreEqual("נשר", Ui.Q<Label>("label-nesher").text, "a 1948 locality with a name_he");
Assert.AreEqual("Na'ana", Ui.Q<Label>("label-naana").text, "no name_he: the English name stays");
+ var locations = Inputs.Content.MapLocations.ToDictionary(l => l.Id);
+ Assert.AreEqual("מערב ירושלים", Ui.Q<Label>("label-jerusalem").text, "#1008: Jerusalem's pill is West Jerusalem's");
foreach (var s in map.Settlements)
- Assert.AreEqual(string.IsNullOrWhiteSpace(s.NameHe) ? s.Name : s.NameHe, Ui.Q<Label>("label-" + s.Id).text, s.Id);
+ Assert.AreEqual(locations.TryGetValue(s.Id, out var named) ? named.NameHe : string.IsNullOrWhiteSpace(s.NameHe) ? s.Name : s.NameHe, Ui.Q<Label>("label-" + s.Id).text, s.Id);
+ foreach (var l in locations.Values) Assert.AreEqual(l.NameHe, Ui.Q<Label>("label-" + l.Id).text, l.Id);
foreach (var p in map.Localities)
Assert.AreEqual(string.IsNullOrWhiteSpace(p.NameHe) ? p.Settlement.Name : p.NameHe, Ui.Q<Label>("label-" + p.Settlement.Id).text, p.Settlement.Id);
game.Language = UiLanguage.English;
game.Begin(Inputs, 0);
Assert.AreEqual("Nahalal", Ui.Q<Label>("label-nahalal").text);
- foreach (var s in map.Settlements) Assert.AreEqual(s.Name, Ui.Q<Label>("label-" + s.Id).text, $"after an English restart: {s.Id}");
+ foreach (var s in map.Settlements)
+ Assert.AreEqual(locations.TryGetValue(s.Id, out var named) ? named.Name : s.Name, Ui.Q<Label>("label-" + s.Id).text, $"after an English restart: {s.Id}");
+ foreach (var l in locations.Values) Assert.AreEqual(l.Name, Ui.Q<Label>("label-" + l.Id).text, $"after an English restart: {l.Id}");
foreach (var p in map.Localities) Assert.AreEqual(p.Settlement.Name, Ui.Q<Label>("label-" + p.Settlement.Id).text, $"after an English restart: {p.Settlement.Id}");
}
diff --git a/unity/Assets/Tests/EditMode/MapLabelTests.cs b/unity/Assets/Tests/EditMode/MapLabelTests.cs
index dd0e71c5d..654e12869 100644
--- a/unity/Assets/Tests/EditMode/MapLabelTests.cs
+++ b/unity/Assets/Tests/EditMode/MapLabelTests.cs
@@ -203,6 +203,127 @@ public class MapLabelTests
Assert.AreEqual(StyleKeyword.Null, container.style.display.keyword, "on clears the inline display, so the loading rule still wins (review M1)");
}
+ static System.Collections.Generic.List<Statecraft.Sim.MapLocation> Locations() => Statecraft.Sim.ContentLoader.Load(Statecraft.Game.Paths.Content).MapLocations;
+
+ /// <summary>Issue #1008: every GDD v0.2 map location in content/map/locations_1948.yaml is named on the map, in English and
+ /// in Hebrew. The one that reuses a game settlement's id (jerusalem) renames that settlement's pill, so Jerusalem reads
+ /// "West Jerusalem" with no second pill; each other location has exactly one pill of its own, which ignores the pointer.</summary>
+ [Test]
+ public void EveryMapLocationIsNamedOnceInEnglishAndHebrew()
+ {
+ var locations = Locations();
+ var settlementIds = map.Settlements.Select(s => s.Id).ToHashSet();
+ var own = locations.Where(l => !settlementIds.Contains(l.Id)).ToList();
+ Assert.AreEqual(10, locations.Count, "the #1008 roster");
+ Assert.AreEqual(new[] { "jerusalem" }, locations.Where(l => settlementIds.Contains(l.Id)).Select(l => l.Id).ToArray());
+ foreach (var hebrew in new[] { false, true })
+ {
+ using var ui = new UiTestKit();
+ using var labels = new MapLabelsPresenter(ui.Root, map, cam, hebrew: hebrew, locations: locations);
+ var container = ui.Q<VisualElement>(MapLabelsPresenter.ContainerName);
+ CollectionAssert.AreEqual(own.Select(l => hebrew ? l.NameHe : l.Name).ToArray(), labels.LocationLabels.Select(l => l.text).ToArray(), hebrew ? "he" : "en");
+ foreach (var l in own)
+ {
+ Assert.AreEqual(1, container.Query<VisualElement>("slot-" + l.Id).ToList().Count, l.Id + ": one pill");
+ Assert.IsFalse(string.IsNullOrWhiteSpace(hebrew ? l.NameHe : l.Name), l.Id);
+ }
+ foreach (var l in labels.LocationLabels)
+ {
+ Assert.IsTrue(l.ClassListContains(MapLabelsPresenter.LabelClass) && l.ClassListContains(MapLabelsPresenter.LocationClass), l.text);
+ Assert.AreEqual(PickingMode.Ignore, l.pickingMode, l.text + " must not catch map clicks");
+ }
+ Assert.AreEqual(1, container.Query<VisualElement>("slot-jerusalem").ToList().Count, "Jerusalem keeps one pill");
+ Assert.AreEqual(hebrew ? "מערב ירושלים" : "West Jerusalem", labels.Labels[map.Settlements.ToList().FindIndex(s => s.Id == "jerusalem")].text);
+ Assert.AreEqual(map.Settlements.Count + own.Count + map.Localities.Count + 1, container.childCount, "settlements, locations, localities and the tooltip");
+ }
+ Assert.AreEqual("village", MapLabelsPresenter.LabelType("fort"));
+ Assert.AreEqual("kibbutz", MapLabelsPresenter.LabelType("kibbutz"));
+ Assert.AreEqual("city", MapLabelsPresenter.LabelType("city"));
+ }
+
+ /// <summary>Issue #1008: two locations in one hex stay two readable pills. Negba and the Iraq Suwaydan police fort share
+ /// hex (-7, 25), and West Jerusalem (the jerusalem settlement's pill) and East Jerusalem / Old City share (0, 23). Close up,
+ /// in English and in Hebrew, both pills of each pair are shown, and no two shown pills overlap.</summary>
+ [UnityTest]
+ public IEnumerator LocationsSharingAHexAreBothNamedAndNeverOverlap()
+ {
+ var locations = Locations();
+ var failures = new System.Collections.Generic.List<string>();
+ foreach (var hebrew in new[] { false, true })
+ {
+ var hd = new HdPanel(cam);
+ if (hebrew) (hd.Root.Q("root") ?? hd.Root).AddToClassList(UiLanguage.HebrewClass);
+ var labels = new MapLabelsPresenter(hd.Root, map, cam, hebrew: hebrew, locations: locations);
+ try
+ {
+ foreach (var (a, b, lon, lat) in new[] { ("negba", "iraq_suwaydan_fort", 34.6825, 31.6545), ("jerusalem", "east_jerusalem_old_city", 35.23, 31.778) })
+ {
+ Pose(lon, lat, 20000f);
+ for (int i = 0; i < 20 && labels.LocationLabels.Concat(labels.Labels).Any(l => float.IsNaN(l.resolvedStyle.width) || l.resolvedStyle.width <= 0); i++) yield return null;
+ labels.Refresh(force: true); yield return null;
+ labels.Refresh(force: true); yield return null;
+ var all = labels.Slots.Concat(labels.LocationSlots).Concat(labels.LocalitySlots).ToList();
+ string lang = hebrew ? "he" : "en";
+ foreach (var id in new[] { a, b })
+ if (!Shown(all.Single(s => s.name == "slot-" + id))) failures.Add($"{lang} at {lon},{lat}: {id} is not shown");
+ var shown = all.Where(Shown).Select(x => (id: x.name, rect: x.Q<Label>().worldBound)).ToList();
+ TestContext.WriteLine($"{lang} 20 km over {a}/{b}: {string.Join(" ", shown.Select(x => x.id + "@" + x.rect))}");
+ for (int i = 0; i < shown.Count; i++)
+ for (int j = i + 1; j < shown.Count; j++)
+ if (shown[i].rect.Overlaps(shown[j].rect)) failures.Add($"{lang}: {shown[i].id} overlaps {shown[j].id}");
+ }
+ }
+ finally { labels.Dispose(); hd.Dispose(); }
+ }
+ Assert.IsEmpty(failures, string.Join("\n", failures));
+ }
+
+ /// <summary>Issue #1008 beside #707: the Latrun police fort's pill and MATKOT's Tegart fort model (SpecialBuildingModels,
+ /// streamed close up from 15 May 1948) do not cover each other. With the real prefab placed and the camera at 30 km over
+ /// Latrun (inside the model's close zoom), the pill is shown and its rectangle clears the model's projected bounds.</summary>
+ [UnityTest]
+ public IEnumerator TheLatrunFortsPillClearsTheTegartFortModel()
+ {
+ var saved = Statecraft.Game.Map.Collection.SpecialBuildingModels.Request;
+ Statecraft.Game.Map.Collection.SpecialBuildingModels.Request = (id, detail, done) =>
+ done(AssetDatabase.LoadAssetAtPath<GameObject>(Statecraft.Game.Map.Collection.CollectionCatalog.PrefabPath(id, detail)));
+ var hd = new HdPanel(cam);
+ MapLabelsPresenter? labels = null;
+ try
+ {
+ var layer = Statecraft.Game.Map.Collection.SpecialBuildingModels.ShowAt(map, new System.DateTime(1948, 5, 15))!;
+ var fort = layer.transform.Find("latrun_tegart");
+ Assert.IsNotNull(fort, "the Tegart fort model stands at Latrun on 15 May 1948");
+ labels = new MapLabelsPresenter(hd.Root, map, cam, locations: Locations());
+ Pose(34.98, 31.835, 30000f);
+ for (int i = 0; i < 20 && labels.LocationLabels.Any(l => float.IsNaN(l.resolvedStyle.width) || l.resolvedStyle.width <= 0); i++) yield return null;
+ labels.Refresh(force: true); yield return null;
+ labels.Refresh(force: true); yield return null;
+ var slot = labels.LocationSlots.Single(s => s.name == "slot-latrun_fort");
+ Assert.IsTrue(Shown(slot), "the Latrun police fort is named at 30 km");
+ var pill = slot.Q<Label>().worldBound;
+ float x0 = float.MaxValue, y0 = float.MaxValue, x1 = float.MinValue, y1 = float.MinValue;
+ foreach (var r in fort!.GetComponentsInChildren<Renderer>(true))
+ {
+ var b = r.bounds;
+ for (int c = 0; c < 8; c++)
+ {
+ var corner = new Vector3((c & 1) == 0 ? b.min.x : b.max.x, (c & 2) == 0 ? b.min.y : b.max.y, (c & 4) == 0 ? b.min.z : b.max.z);
+ var q = hd.ToPanel(corner, out bool front); Assert.IsTrue(front);
+ x0 = Mathf.Min(x0, q.x); y0 = Mathf.Min(y0, q.y); x1 = Mathf.Max(x1, q.x); y1 = Mathf.Max(y1, q.y);
+ }
+ }
+ var model = Rect.MinMaxRect(x0, y0, x1, y1);
+ TestContext.WriteLine($"latrun_fort pill {pill}; Tegart model {model}");
+ Assert.IsFalse(pill.Overlaps(model), $"the pill {pill} covers the fort model {model}");
+ }
+ finally
+ {
+ labels?.Dispose(); hd.Dispose();
+ Statecraft.Game.Map.Collection.SpecialBuildingModels.Request = saved;
+ }
+ }
+
[Test]
public void LabelsOffScreenAreHiddenAndComeBack()
{