F2: industria servita come ultimo giorno di servizio nel trimestre
Il flag giornaliero veniva azzerato dalle stazioni prima della valutazione trimestrale; ora conta l'essere stata servita almeno un giorno nel trimestre. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0191R7vXgtbAvSV4V8tj8uzL
This commit is contained in:
7 files changed
+24
-15
No files matched your search
@@ -25,7 +25,7 @@ public sealed class StationSystem : ISimSystem
|
||||
{
|
||||
foreach (var s in net.Stations) RailCommandHandlers.UpdateCatchment(w, s);
|
||||
}
|
||||
MarkServed(w);
|
||||
MarkServed(w, ctx.Day);
|
||||
foreach (var s in net.Stations)
|
||||
{
|
||||
if (net.Nodes[s.Node.Value].Station != s.Id) continue;
|
||||
@@ -40,13 +40,12 @@ public sealed class StationSystem : ISimSystem
|
||||
}
|
||||
|
||||
/// <summary>Un'industria è servita se sta nel bacino di una stazione fermata di una linea con treni.</summary>
|
||||
private static void MarkServed(World w)
|
||||
private static void MarkServed(World w, long day)
|
||||
{
|
||||
foreach (var i in w.Industries) i.Served = false;
|
||||
foreach (var s in w.Network.Stations)
|
||||
{
|
||||
if (!IsServedStation(w, s)) continue;
|
||||
foreach (var id in s.Industries) w.Industries[id.Value].Served = true;
|
||||
foreach (var id in s.Industries) w.Industries[id.Value].LastServedDay = day;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user