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>
27 lines
991 B
C#
27 lines
991 B
C#
using Godot;
|
|
using RailEnterprise.Core.Data;
|
|
|
|
namespace RailEnterprise.Client.App;
|
|
|
|
/// <summary>File dati del gioco dentro il progetto Godot (res://data, copiati dalla build del client).</summary>
|
|
public sealed class GodotDataSource(string root = "res://data") : IDataSource
|
|
{
|
|
public string Description => root;
|
|
|
|
public bool Exists(string relativePath) => Godot.FileAccess.FileExists($"{root}/{relativePath}");
|
|
|
|
public string ReadText(string relativePath)
|
|
{
|
|
using var f = Godot.FileAccess.Open($"{root}/{relativePath}", Godot.FileAccess.ModeFlags.Read)
|
|
?? throw new FileNotFoundException(relativePath);
|
|
return f.GetAsText();
|
|
}
|
|
|
|
/// <summary>Dati del gioco: res://data se presenti, altrimenti la cartella data del repository.</summary>
|
|
public static GameData LoadGameData()
|
|
{
|
|
var source = new GodotDataSource();
|
|
return source.Exists("goods.json") ? GameData.Load(source) : GameData.LoadDefault();
|
|
}
|
|
}
|