61 lines
1.8 KiB
C#
61 lines
1.8 KiB
C#
namespace IdleSpectator;
|
|
|
|
/// <summary>
|
|
/// Single source of truth: would the orange dossier show this EventLed Label?
|
|
/// Selection must equal presentation - unpresentable beats must not win Watching.
|
|
/// </summary>
|
|
public static class EventPresentability
|
|
{
|
|
/// <summary>
|
|
/// True when the candidate may own Layer A camera.
|
|
/// Empty Label is only allowed for CharacterLed fill (task chip, no orange reason).
|
|
/// </summary>
|
|
public static bool WouldShow(InterestCandidate scene)
|
|
{
|
|
if (scene == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(scene.Label))
|
|
{
|
|
return scene.LeadKind == InterestLeadKind.CharacterLed;
|
|
}
|
|
|
|
return !string.IsNullOrEmpty(UnitDossier.EvaluateSceneLabel(scene, recordDrops: false));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Shown orange reason, or empty when blanked by identity / ownership rules.
|
|
/// </summary>
|
|
public static string ShownReason(InterestCandidate scene, bool recordDrops = true)
|
|
{
|
|
return UnitDossier.EvaluateSceneLabel(scene, recordDrops);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Harness synthetic tips ("HoldAction") must be subject-led EventReason shape
|
|
/// so the presentability gate matches production dossier rules.
|
|
/// </summary>
|
|
public static string EnsureSubjectLedLabel(Actor subject, string label)
|
|
{
|
|
if (string.IsNullOrEmpty(label))
|
|
{
|
|
return label ?? "";
|
|
}
|
|
|
|
string name = EventFeedUtil.SafeName(subject);
|
|
if (string.IsNullOrEmpty(name))
|
|
{
|
|
return label;
|
|
}
|
|
|
|
if (label.StartsWith(name, System.StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return label;
|
|
}
|
|
|
|
// "Name is in scene: HoldAction" → EventSentence + subject-led first token.
|
|
return name + " is in scene: " + label;
|
|
}
|
|
}
|