ComponentOutputs
namespace Griff.Scenes;
public static class ComponentOutputsThe outputs (OutputAttribute) of component types, found the first time each type is asked about and kept for as long as it’s loaded, and reading one by name.
Methods
Section titled “Methods”public static ComponentOutput? Find(Component component, ReadOnlySpan<char> reference)The output of component that reference names (see IsCalled; anything after a colon is the name it’s read by), or null.
public static ValueTuple<Component, ComponentOutput>? Find(Entity entity, ReadOnlySpan<char> reference)The first component of entity with an output reference names, and that output; null when none has one.
public static string KeyOf(string reference)The name an output is read by in a reference: “Gold” of “Amount:Gold”; empty without one.
NameOf
Section titled “NameOf”public static ReadOnlySpan<char> NameOf(ReadOnlySpan<char> reference)The output’s name in a reference: “Amount” of “Amount:Gold”.
public static IReadOnlyList<ComponentOutput> Of(Type type)The outputs of type (its base types’ too), in the order they’re declared, base types first.
public static IReadOnlyList<ComponentOutput> On(IEnumerable<Entity> entities)Every output of entities’ components, each once, in the order the entities and their components come: what a counter, bar, text or wire reading them can pick.
public static float Read(Entity entity, string? reference)What entity’s output reference (e.g. “Score”, “MatchBoard.Score” or “Amount:Gold”) gives right now, as a number; 0 if it has no such output.