Merge origin/master into mining: resolve five conflicts by owner, delete the belt-task machine
Mining owns belts, chunks and target picking; scenarios owns admission and run staging; master owns ships and fire control (rule scenarios-cut.md S4). - AetheriaStores.CatalogTypes: nine-type union, master's list plus FieldKindData, no Scenario. - tools/AetherDb/Program.cs: both cases (ship-authoring, field-kinds), one usage string. - Zone.cs: master's MineAsteroid dropped (mining deleted its inputs); scenarios' SettleBelts and its three calls deleted. - RunStartTests: the two belt-task tests deleted (they read belt.Transforms and MineAsteroid). - FireControlCut124Tests: master's strict Exact assertions; mining's CompatibleDrift allowance and its comment dropped. - GameData/Aetheria.cc: master's pointer 70a7b0a9. This commit lacks the Asteroid field kind in the catalog, so TheShippedCatalogHasAPickableFieldKind fails here by design; the next commit rebuilds it. Builds: this commit builds (verified at the end with commit 2); the catalog pin test fails at this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
d9f85dc639
154 changed files with 8764 additions and 4522 deletions
|
|
@ -94,7 +94,7 @@ public class Zone
|
|||
|
||||
// Cut 5, 5.6 (docs/fire-control-cut.md, Soul finding 7; operator ruling Q3): death removes the ship,
|
||||
// in the simulation, not only in Unity's own loot-drop subscription. One subscription point covers
|
||||
// every join, whichever call site adds the entity (deserialization below, a jump, a spawned turret) --
|
||||
// every join, whichever caller admits the entity (deserialization below, a jump, a spawned turret) --
|
||||
// ObserveAdd fires for all of them. Forbidden writer: no presentation may remove an entity from Zone.
|
||||
Entities.ObserveAdd().Subscribe(add => add.Value.Death.Subscribe(_ => { Entities.Remove(add.Value); add.Value.Deactivate(); }));
|
||||
|
||||
|
|
@ -142,19 +142,27 @@ public class Zone
|
|||
foreach (var entityPack in pack.Entities)
|
||||
{
|
||||
var entity = EntitySerializer.Unpack(_itemManager, this, entityPack);
|
||||
Entities.Add(entity);
|
||||
entity.Activate();
|
||||
if (entity is Ship {IsPlayerShip: false} ship)
|
||||
{
|
||||
Agents.Add(CreateAgent(ship));
|
||||
if (lengthsq(ship.Position) < 1)
|
||||
ship.Position = _itemManager.Random.NextFloat3(float3(-pack.Radius * .5f), float3(pack.Radius * .5f));
|
||||
}
|
||||
var ship = entity as Ship;
|
||||
Admit(entity, piloted: ship is {IsPlayerShip: false});
|
||||
// Generation placement, not admission: a ship packed at the origin is scattered across the zone.
|
||||
if (ship is {IsPlayerShip: false} && lengthsq(ship.Position) < 1)
|
||||
ship.Position = _itemManager.Random.NextFloat3(float3(-pack.Radius * .5f), float3(pack.Radius * .5f));
|
||||
}
|
||||
|
||||
// TODO: Associate planets with stored entities for planetary colonies
|
||||
}
|
||||
|
||||
// The one admission into this zone (docs/scenarios-cut.md, 2.2): the only writer of Entities.Add and the only
|
||||
// creator of agents. Construction, new-run staging (RunStart), warp arrival, undock and the console's spawned
|
||||
// turret all join through here. A piloted entity gets the zone's Minion; an unpiloted one gets no agent at all.
|
||||
// Only a ship can be piloted. The Death subscription above covers every join, whichever caller admits it.
|
||||
public void Admit(Entity entity, bool piloted)
|
||||
{
|
||||
Entities.Add(entity);
|
||||
entity.Activate();
|
||||
if (piloted) Agents.Add(CreateAgent((Ship) entity));
|
||||
}
|
||||
|
||||
private Agent CreateAgent(Ship ship)
|
||||
{
|
||||
var agent = new Minion(ship);
|
||||
|
|
|
|||
Loading…
Reference in a new issue