Table of Contents

Interface ILuaRuleSource

Namespace
EncDotNet.S100.Pipelines.Vector
Assembly
EncDotNet.S100.Core.dll

Capability interface for catalogues that supply Lua portrayal rules (S-100 Part 9A). A catalogue implements this interface as part of IVectorPortrayalCatalogue; products that ship no Lua rules (e.g. the GML/XSLT products) return an empty list from GetLuaSourceNamesAsync(CancellationToken) and an empty ContextParameters.

public interface ILuaRuleSource

Remarks

This is the Core seam through which the generic LuaRuleExecutor obtains everything it needs from a catalogue: the manifest-declared list of Lua rule files and the raw source for each one (for the MoonSharp require() loader and main.lua), plus the declared context-parameter set (to initialise the Lua side and to filter mariner overrides). It deliberately does not expose a compiled script type, preserving per-render sandbox isolation.

The interface is purely asynchronous so the catalogue stays an unopinionated data source. The MoonSharp require() module loader is itself synchronous (we do not own MoonSharp), so the executor — not the catalogue — is responsible for awaiting all source files into a local snapshot dictionary before invoking the Lua engine, and capturing that dictionary inside the sync loader callback.

Properties

ContextParameters

The context parameters declared by the catalogue (S-100 Part 9A), used to initialise the Lua portrayal model and to filter MarinerSettings overrides to the names the catalogue actually understands. Empty for catalogues without Lua rules.

IReadOnlyList<LuaContextParameter> ContextParameters { get; }

Property Value

IReadOnlyList<LuaContextParameter>

Methods

GetLuaSourceAsync(string, CancellationToken)

Returns the raw Lua source for the given bare file name inside the portrayal catalogue's Rules/ directory (e.g. "main.lua", "S100Scripting.lua"), or null if the file is not present — honouring the MoonSharp module loader's "missing module → return null" contract.

ValueTask<string?> GetLuaSourceAsync(string fileName, CancellationToken cancellationToken = default)

Parameters

fileName string
cancellationToken CancellationToken

Returns

ValueTask<string>

GetLuaSourceNamesAsync(CancellationToken)

Returns the bare file names (e.g. "main.lua", "S100Scripting.lua") of every Lua rule file declared in the portrayal catalogue manifest. The returned list is intended to be memoized by the catalogue; the executor uses it to drive GetLuaSourceAsync(string, CancellationToken) calls before kicking off the synchronous MoonSharp engine.

ValueTask<IReadOnlyList<string>> GetLuaSourceNamesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask<IReadOnlyList<string>>