Class S411PortrayalCatalogue
S-411 portrayal catalogue. Extends GmlPortrayalCatalogueBase
with an adapter XSLT for the mainRule, single-rule-only rule list,
no multi-palette fallback, and fetch-rule resolver.
public sealed class S411PortrayalCatalogue : GmlPortrayalCatalogueBase, IVectorPortrayalCatalogue, IPortrayalCatalogue, IXsltRuleSource, ILuaRuleSource, IPortrayalAssetSource
- Inheritance
-
S411PortrayalCatalogue
- Implements
- Inherited Members
Constructors
S411PortrayalCatalogue(PortrayalCatalogueProvider)
Creates an S-411 portrayal catalogue backed by the given provider.
public S411PortrayalCatalogue(PortrayalCatalogueProvider provider)
Parameters
providerPortrayalCatalogueProviderThe portrayal catalogue provider that supplies rule files and assets.
Exceptions
- ArgumentNullException
providerisnull.
Properties
Spec
The product specification (name + edition) this catalogue targets.
public override SpecRef Spec { get; }
Property Value
Methods
BuildRules()
Only the master mainRule top-level template is included; the
per-class top-level templates are still loadable on demand via
GetCompiledRuleAsync(string, CancellationToken).
protected override IReadOnlyList<PortrayalRule> BuildRules()
Returns
CreateXmlResolver(IReadOnlyDictionary<string, byte[]>)
Creates an XmlResolver used to resolve
xsl:include/xsl:import URIs during XSLT compilation.
protected override XmlResolver CreateXmlResolver(IReadOnlyDictionary<string, byte[]> registeredBytes)
Parameters
registeredBytesIReadOnlyDictionary<string, byte[]>
Returns
Remarks
The default implementation resolves filenames against the pre-fetched rule-file bytes dictionary. Override to add fallback resolution strategies (e.g. FetchRuleAsync(string, CancellationToken) for specs whose sub-templates are not registered as rule files).
GetCompiledRuleAsync(string, CancellationToken)
For the mainRule, substitutes the library's bundled adapter XSLT
which produces the display-list dialect expected by this codebase's
Part9DisplayListReader. All other rules delegate to base.
public override ValueTask<XslCompiledTransform> GetCompiledRuleAsync(string ruleName, CancellationToken cancellationToken = default)
Parameters
ruleNamestringcancellationTokenCancellationToken
Returns
LoadPalettesAsync(Dictionary<PaletteType, ColorPalette>, CancellationToken)
S-411 1.2.1 PC ships no day/dusk/night colour profiles with multi-palette fallback; only load explicitly named palettes.
protected override Task LoadPalettesAsync(Dictionary<PaletteType, ColorPalette> palettes, CancellationToken cancellationToken)
Parameters
palettesDictionary<PaletteType, ColorPalette>cancellationTokenCancellationToken