ProblemLog
namespace Griff.Scenes;
public sealed class ProblemLogThe one place a mistake in a game’s data goes (see docs/architecture.md): a game, a loader, the scene serializer and a simulation all report here, and the editor’s Output, the Inspector and the agent tools read from here. The rule it serves: a mistake in a game’s data warns, once, and the game goes on; a mistake in code throws. It is also an ICollection of the lines said, so the loaders’ warnings parameters take it.
Properties
Section titled “Properties”public int Count { get; }public IReadOnlyList<string> Lines { get; }The words of every problem reported.
Problems
Section titled “Problems”public IReadOnlyList<Problem> Problems { get; }Every problem reported, in the order they came.
Methods
Section titled “Methods”public void Clear()Forgets everything said, for a run that starts over.
GetEnumerator
Section titled “GetEnumerator”public IEnumerator<string> GetEnumerator()MarkSaid
Section titled “MarkSaid”public void MarkSaid(IEnumerable<string> messages)Counts messages as said, without telling anyone: a host that already showed them (the loader’s).
public IEnumerable<Problem> On(Component component)The problems found on component.
Report
Section titled “Report”public void Report(Problem problem)Reports problem, unless these words were said already.
Report
Section titled “Report”public void Report(string message, Component? component = null)Reports a problem, naming component (and its entity) when it is on one; said once.
Events
Section titled “Events”Reported
Section titled “Reported”public event Action<Problem>? ReportedRaised for each new problem (never twice for the same words), on the thread that reported it.