Skip to content

ProblemLog

namespace Griff.Scenes;
public sealed class ProblemLog

The 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.

public int Count { get; }
public IReadOnlyList<string> Lines { get; }

The words of every problem reported.

public IReadOnlyList<Problem> Problems { get; }

Every problem reported, in the order they came.

public void Clear()

Forgets everything said, for a run that starts over.

public IEnumerator<string> GetEnumerator()
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.

public void Report(Problem problem)

Reports problem, unless these words were said already.

public void Report(string message, Component? component = null)

Reports a problem, naming component (and its entity) when it is on one; said once.

public event Action<Problem>? Reported

Raised for each new problem (never twice for the same words), on the thread that reported it.