Il progetto adotta il nome «Rail Enterprise» ovunque (codice RailEnterprise.*, variabili RE_*, intestazioni RESV/RECL, immagine rail-enterprise-server) per allinearsi al repository Gitea. Aggiunge Gitea Actions sul modello di Chronos: CI su PR e main, rilascio da tag con gioco Windows (client Godot + server in server/), server Windows/Linux e immagine Docker nel registro Gitea, nightly. Aggiunge i riferimenti visivi 06–09, i modelli di PR e issue, l'ADR 0014 e aggiorna README (comandi locali), STATE e CLAUDE.md. 120 test verdi. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
2.4 KiB
C#
47 lines
2.4 KiB
C#
using RailEnterprise.Core.Common;
|
|
using RailEnterprise.Core.Economy;
|
|
|
|
namespace RailEnterprise.Core.Simulation;
|
|
|
|
/// <summary>Primato della Cronaca finale.</summary>
|
|
public readonly record struct ChronicleRecord(string Title, string Value, int Year);
|
|
|
|
/// <summary>
|
|
/// Cronaca finale della compagnia del giocatore (12.3): storia anno per anno (con l'anno in
|
|
/// corso), primati, fatti salienti e prestigio. Il prestigio di F5 è un punteggio semplice
|
|
/// (livelli, patrimonio massimo, anni di attività) che la F7 estende (ADR 0012).
|
|
/// </summary>
|
|
public sealed class ChronicleReport
|
|
{
|
|
public List<CompanyYear> History { get; } = [];
|
|
public List<ChronicleRecord> Records { get; } = [];
|
|
public List<string> Highlights { get; } = [];
|
|
public long Prestige { get; private set; }
|
|
|
|
public static ChronicleReport Build(World w)
|
|
{
|
|
var c = w.Player;
|
|
var report = new ChronicleReport();
|
|
report.History.AddRange(c.History);
|
|
var current = Corporate.Snapshot(w, c, w.Clock.Year, c.YearEntries);
|
|
if (report.History.Count == 0 || report.History[^1].Year != current.Year) report.History.Add(current);
|
|
|
|
var richest = report.History.MaxBy(y => y.NetWorthCents);
|
|
var best = report.History.MaxBy(y => y.ProfitCents);
|
|
var fleet = report.History.MaxBy(y => y.Trains);
|
|
var track = report.History.MaxBy(y => y.TrackKm);
|
|
report.Records.Add(new ChronicleRecord("Patrimonio netto massimo", new Money(richest.NetWorthCents).ToString(), richest.Year));
|
|
report.Records.Add(new ChronicleRecord("Anno più redditizio", new Money(best.ProfitCents).ToString(), best.Year));
|
|
report.Records.Add(new ChronicleRecord("Flotta più grande", $"{fleet.Trains} treni", fleet.Year));
|
|
report.Records.Add(new ChronicleRecord("Rete più estesa", $"{track.TrackKm:0.0} km", track.Year));
|
|
int maxTier = report.History.Max(y => y.Tier);
|
|
var tierYear = report.History.First(y => y.Tier == maxTier);
|
|
report.Records.Add(new ChronicleRecord("Livello più alto", w.Data.Tiers.Tiers[Math.Clamp(maxTier, 1, w.Data.Tiers.Tiers.Count) - 1].NameIt, tierYear.Year));
|
|
|
|
foreach (var m in c.Milestones) report.Highlights.Add($"{w.Calendar.DateOfDay(m.Day)}: {m.Text}");
|
|
int years = Math.Max(0, w.Clock.Year - w.Calendar.StartYear);
|
|
report.Prestige = 100L * maxTier + richest.NetWorthCents / 1_000_000 + 5L * years;
|
|
return report;
|
|
}
|
|
}
|