feat: simplified local-space and celestial, removed bubbles

This commit is contained in:
2026-03-18 08:49:35 -04:00
parent 00a008bda5
commit 933c6afd08
19 changed files with 246 additions and 448 deletions

View File

@@ -88,27 +88,26 @@ public sealed partial class ScenarioLoader
private static List<ClaimRuntime> CreateClaims(
IReadOnlyCollection<StationRuntime> stations,
IReadOnlyCollection<NodeRuntime> nodes,
IReadOnlyCollection<CelestialRuntime> celestials,
DateTimeOffset nowUtc)
{
var stationsByAnchorNodeId = stations
.Where((station) => station.AnchorNodeId is not null)
.ToDictionary((station) => station.AnchorNodeId!, StringComparer.Ordinal);
var stationsByCelestialId = stations
.Where((station) => station.CelestialId is not null)
.ToDictionary((station) => station.CelestialId!, StringComparer.Ordinal);
var claims = new List<ClaimRuntime>();
foreach (var node in nodes.Where((candidate) => candidate.Kind == SpatialNodeKind.LagrangePoint))
foreach (var celestial in celestials.Where((c) => c.Kind == SpatialNodeKind.LagrangePoint))
{
if (!stationsByAnchorNodeId.TryGetValue(node.Id, out var station))
if (!stationsByCelestialId.TryGetValue(celestial.Id, out var station))
{
continue;
}
claims.Add(new ClaimRuntime
{
Id = $"claim-{node.Id}",
Id = $"claim-{celestial.Id}",
FactionId = station.FactionId,
SystemId = node.SystemId,
NodeId = node.Id,
BubbleId = node.BubbleId,
SystemId = celestial.SystemId,
CelestialId = celestial.Id,
PlacedAtUtc = nowUtc,
ActivatesAtUtc = nowUtc.AddSeconds(8),
State = ClaimStateKinds.Activating,
@@ -122,7 +121,6 @@ public sealed partial class ScenarioLoader
private static (List<ConstructionSiteRuntime> ConstructionSites, List<MarketOrderRuntime> MarketOrders) CreateConstructionSites(
IReadOnlyCollection<StationRuntime> stations,
IReadOnlyCollection<ClaimRuntime> claims,
IReadOnlyCollection<NodeRuntime> nodes,
IReadOnlyDictionary<string, ModuleRecipeDefinition> moduleRecipes)
{
var sites = new List<ConstructionSiteRuntime>();
@@ -131,18 +129,12 @@ public sealed partial class ScenarioLoader
foreach (var station in stations)
{
var moduleId = GetNextConstructionSiteModule(station, moduleRecipes);
if (moduleId is null || station.AnchorNodeId is null)
if (moduleId is null || station.CelestialId is null)
{
continue;
}
var anchorNode = nodes.FirstOrDefault((node) => node.Id == station.AnchorNodeId);
if (anchorNode is null)
{
continue;
}
var claim = claims.FirstOrDefault((candidate) => candidate.NodeId == anchorNode.Id);
var claim = claims.FirstOrDefault((candidate) => candidate.CelestialId == station.CelestialId);
if (claim is null || !moduleRecipes.TryGetValue(moduleId, out var recipe))
{
continue;
@@ -153,8 +145,7 @@ public sealed partial class ScenarioLoader
Id = $"site-{station.Id}",
FactionId = station.FactionId,
SystemId = station.SystemId,
NodeId = anchorNode.Id,
BubbleId = anchorNode.BubbleId,
CelestialId = station.CelestialId,
TargetKind = "station-module",
TargetDefinitionId = "station",
BlueprintId = moduleId,