From ce2fb80e7c7f214262fd0abc4b5064275fc96d3b Mon Sep 17 00:00:00 2001 From: soul Date: Sat, 28 Nov 2026 23:10:49 +0100 Subject: [PATCH] Rename RegionClock.AdvanceFacilities to AdvanceInstalled: what the span runs is installed plant, not only facilities (cut habitation-gear) Co-Authored-By: Claude Sonnet 5.5 --- Assets/Scripts/ServerShared/Behaviors/Facility.cs | 2 +- Assets/Scripts/ServerShared/RegionClock.cs | 4 ++-- Assets/Scripts/ServerShared/Zone.cs | 4 ++-- tools/AetherDb/EconomyDrain.cs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/ServerShared/Behaviors/Facility.cs b/Assets/Scripts/ServerShared/Behaviors/Facility.cs index 9144a4914..2e324a1d4 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Facility.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Facility.cs @@ -19,7 +19,7 @@ public class FacilityData : BehaviorData } // The installed facility (ruling demand-consumed-inputs-processed-by-facilities). It ticks once per zone step, from EquippedItem.Update -// while the item is active, on screen; off screen RegionClock.AdvanceFacilities calls Execute with the span the zone missed. Its recipes are the run list of its design, fixed for a run because the catalog is. +// while the item is active, on screen; off screen RegionClock.AdvanceInstalled calls Execute with the span the zone missed. Its recipes are the run list of its design, fixed for a run because the catalog is. public class Facility : Behavior { private IReadOnlyList _runList; diff --git a/Assets/Scripts/ServerShared/RegionClock.cs b/Assets/Scripts/ServerShared/RegionClock.cs index 9ac852fac..03b7b4cca 100644 --- a/Assets/Scripts/ServerShared/RegionClock.cs +++ b/Assets/Scripts/ServerShared/RegionClock.cs @@ -49,10 +49,10 @@ public static class RegionClock public static ZonePack Seen(GalaxyZone zone, Zone current) => zone.Contents != null && zone.Contents == current ? current.PackZone() : zone.LastSeen; - // Every facility of the entity runs `seconds`, as EquippedItem.Update runs it each step: a unit that is enabled and not + // The entity's installed plant runs `seconds`, as EquippedItem.Update runs it each step: a unit that is enabled and not // destroyed (Active also needs ThermalOnline, which only a stepped entity sets, so it is not the off-screen gate). The // units in Equipment order, each unit's Facility behaviours in order. - public static void AdvanceFacilities(Entity entity, double seconds) + public static void AdvanceInstalled(Entity entity, double seconds) { foreach (var unit in entity.Equipment) { diff --git a/Assets/Scripts/ServerShared/Zone.cs b/Assets/Scripts/ServerShared/Zone.cs index 82c4bc511..cfd2801c8 100644 --- a/Assets/Scripts/ServerShared/Zone.cs +++ b/Assets/Scripts/ServerShared/Zone.cs @@ -363,14 +363,14 @@ public class Zone private bool IsExpired(ChunkWear wear) => wear.Damage <= 0f && (!wear.BrokenUntil.HasValue || wear.BrokenUntil.Value <= _time); - // A zone the player is not in, brought to `time` (RegionClock.Step and Enter only): its facilities run the span it missed, + // A zone the player is not in, brought to `time` (RegionClock.Step and Enter only): its installed plant runs the span it missed, // its clock moves, and every orbit is placed at the new time so the next Update differences from it, not from where the // zone was left. public void AdvanceTo(double time) { var span = time - _time; if (!(span > 0)) return; - foreach (var entity in Entities.ToArray()) RegionClock.AdvanceFacilities(entity, span); + foreach (var entity in Entities.ToArray()) RegionClock.AdvanceInstalled(entity, span); _time = time; _updatedOrbits.Clear(); foreach (var orbit in Orbits) GetOrbitPosition(orbit.Key); diff --git a/tools/AetherDb/EconomyDrain.cs b/tools/AetherDb/EconomyDrain.cs index b51d7b2fb..f4082171e 100644 --- a/tools/AetherDb/EconomyDrain.cs +++ b/tools/AetherDb/EconomyDrain.cs @@ -387,7 +387,7 @@ public static class EconomyDrain entity.Equipment.SelectMany(unit => unit.Behaviors.OfType().Select(facility => (unit, facility))); // The copy's facilities, each advanced through `seconds` of sim time in spans of RegionClock.Span by the off-screen step the - // game ships (RegionClock.AdvanceFacilities), in equipment order. Returns the Stall each ended in; each sees the sim time and + // game ships (RegionClock.AdvanceInstalled), in equipment order. Returns the Stall each ended in; each sees the sim time and // the stalls after every span. public Stall[] Spans(Entity copy, double seconds, Action each = null) { @@ -396,7 +396,7 @@ public static class EconomyDrain for (var at = 0.0; at < seconds - 1e-9;) { var span = Math.Min(RegionClock.Span, seconds - at); - RegionClock.AdvanceFacilities(copy, span); + RegionClock.AdvanceInstalled(copy, span); for (var i = 0; i < facilities.Length; i++) last[i] = facilities[i].Stall; at += span; each?.Invoke(at, last);