Merge remote-tracking branch 'origin/main' into claude/f6-pannelli
# Conflicts: # client/RailEnterprise.Client/assets/i18n/strings.csv # client/RailEnterprise.Client/scripts/Main.cs # client/RailEnterprise.Client/scripts/Screens/MenuScreen.cs # docs/ARCHITECTURE.md # docs/PROTOCOL.md # docs/STATE.md # src/RailEnterprise.Protocol/Client/ClientWorld.cs
This commit is contained in:
commit
767661957b
52 files changed
+4074
-91
No files matched your search
@@ -689,6 +689,9 @@ public sealed class GameHost : IDisposable
|
||||
case DetailKind.Finance:
|
||||
if (s.Company.IsValid && s.Company.Value < w.Companies.Count) s.Send(Projection.Finance(w, s.Company));
|
||||
break;
|
||||
case DetailKind.Fleet:
|
||||
if (s.Company.IsValid && s.Company.Value < w.Companies.Count) s.Send(Projection.FleetRenewal(w, s.Company));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -664,6 +664,32 @@ public static class Projection
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>Quadro del rinnovo della flotta per la compagnia della sessione (FleetOutlook, ADR 0020).</summary>
|
||||
public static FleetReport FleetRenewal(World w, CompanyId company)
|
||||
{
|
||||
var report = FleetOutlook.Build(w, company);
|
||||
var interventions = w.Data.Maintenance.Interventions;
|
||||
return new FleetReport
|
||||
{
|
||||
Day = report.Day, Company = report.Company.Value, Year = report.Year, Era = report.Era.Id,
|
||||
NextEra = report.NextEra?.Id ?? "", NextEraYear = report.NextEra?.From ?? 0,
|
||||
RenewalIntervention = interventions.First(i => i.Effect == InterventionEffect.Renew).Id,
|
||||
BookValueTotal = report.BookValueTotal,
|
||||
Vehicles = report.Vehicles.Select(v => new FleetVehicleInfo
|
||||
{
|
||||
Vehicle = v.Id.Value, Type = v.Def.Id, Train = v.Train.Value, Depot = v.Depot.Value, AgeYears = (float)v.AgeYears,
|
||||
LifeYears = v.Def.LifeYears, Condition = (float)v.Condition, InProduction = v.InProduction, Superseded = v.Superseded,
|
||||
SupersededYear = v.SupersededYear ?? 0, Successor = v.Successor?.Id ?? "", BookValue = v.BookValue, Resale = v.ResaleValue,
|
||||
MaintenanceFactor = (float)v.MaintenanceFactor,
|
||||
}).ToList(),
|
||||
Models = report.Models.Select(m => new VehicleModelInfo
|
||||
{
|
||||
Type = m.Def.Id, Superseded = m.Superseded, SupersededYear = m.SupersededYear ?? 0, Successor = m.Successor?.Id ?? "", LastYear = m.LastYear ?? 0,
|
||||
}).ToList(),
|
||||
Trains = report.Trains.Select(t => new RenewalTrainInfo { Train = t.Train.Value, Vehicles = t.Vehicles, NetCost = t.NetCost, Affordable = t.Affordable, Booked = t.Booked }).ToList(),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>Evento del mondo in corso → record del protocollo (ADR 0017).</summary>
|
||||
public static WorldEventInfo WorldEvent(ActiveWorldEvent e) => new()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user