Take the remaining I/O out of the domain and drop AppState.Instance

Scenery translations and load weights get repositories; AppState moves to the
application layer.
This commit is contained in:
maj00r
2026-09-04 21:06:23 +02:00
parent 0444070e12
commit 8e5fe01104
16 changed files with 479 additions and 216 deletions

View File

@@ -0,0 +1,23 @@
using StarterNG.Domain.Sceneries;
namespace StarterNG.Application.Abstractions;
/// <summary>
/// The translations a scenery ships alongside itself, in scenery/i18n/*.json.
/// </summary>
/// <remarks>
/// Scenery text may be an "@key" reference rather than literal prose, resolved
/// against the currently loaded scenery's table. The table is per scenery, so
/// <see cref="LoadFor"/> replaces it rather than adding to it.
/// </remarks>
public interface ISceneryTranslations
{
/// <summary>Loads the tables for one scenery, English first then the user's language.</summary>
void LoadFor(Scenery scenery, string langCode);
/// <summary>
/// Resolves an "@key" reference against the loaded table. Text that is not a
/// reference, or a key with no translation, comes back unchanged.
/// </summary>
string Translate(string? text);
}