feat(quest): QT6 — plugins can read the contract tracker
The last piece of QT6's own scope: r10-quest-dialogs.md §11.6's contract half. IGameState.Contracts exposes what the client structurally knows about quests, which — per that same research — is the tracker and nothing else. The rest of §11.6 (chat stream, tells, give, use, confirmations) is other features and stays out of this campaign. A pull-through source rather than a pushed mirror. Contracts change rarely and are already owned canonically, so a second copy would only be a thing to keep in step; reading through means a plugin cannot observe a stale list. Both hosts implement it. The headless one carries contract id, stage and progress but no names — a bot has no dat access — because losing the TEXT is expected while losing the QUEST would leave a bot silently unable to see what it is on. Same rule covers a contract the installed dat has never heard of: it still projects, with empty text and a correct status, rather than vanishing. The interface member is defaulted so a host predating this campaign still satisfies IGameState. Two lazy catalog loads exist (the panel's and this one) rather than one shared instance. That is deliberate: threading a shared ContractCatalog through three composition records to avoid reading a 322-row immutable table at most twice per session would be plumbing for no correctness or performance gain, and the comment at the call site says so. Campaign QT is complete; the connected user gate is owed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
56beeb720d
commit
fe1e68e5fe
8 changed files with 305 additions and 0 deletions
|
|
@ -99,6 +99,25 @@ internal sealed class HeadlessPluginHost
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Campaign QT slice QT6. Same borrow-don't-own shape as
|
||||
/// <see cref="Entities"/>: projected from the canonical tracker on read.
|
||||
/// Names and status text are empty here — a headless host has no dat
|
||||
/// access — while every numeric field a bot actually branches on
|
||||
/// (contract id, stage, progress) is present.
|
||||
/// </summary>
|
||||
public IReadOnlyList<ContractSnapshot> Contracts
|
||||
{
|
||||
get
|
||||
{
|
||||
ObjectDisposedException.ThrowIf(_disposed, this);
|
||||
return AcDream.Runtime.Gameplay.ContractPluginProjection.Project(
|
||||
_runtime.ContractsOwner.View,
|
||||
catalog: null,
|
||||
now: DateTime.UtcNow);
|
||||
}
|
||||
}
|
||||
|
||||
public event Action<WorldEntitySnapshot> EntitySpawned
|
||||
{
|
||||
add
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue