ComponentOutput
namespace Griff.Scenes;
public sealed class ComponentOutputOne thing a component knows that anything can read (see OutputAttribute): its name, what it gives, and the read itself, which allocates nothing.
Properties
Section titled “Properties”ComponentType
Section titled “ComponentType”public Type ComponentType { get; }The component type it belongs to.
DisplayName
Section titled “DisplayName”public string DisplayName { get; }What it’s called with spaces between the words, e.g. “Moves Left”.
Example
Section titled “Example”public string? Example { get; }For one read by a name, a name it’s read by, e.g. “Gold” (see Example).
FormerNames
Section titled “FormerNames”public IReadOnlyList<string> FormerNames { get; }Names it had before (FormerNameAttribute): what still names it.
IsKeyed
Section titled “IsKeyed”public bool IsKeyed { get; }True for one read by a name: “Amount:Gold”.
IsNumber
Section titled “IsNumber”public bool IsNumber { get; }True for one that gives a number, a whole number or true or false (1 or 0): what a counter, a bar and a wire can read.
KeyName
Section titled “KeyName”public string? KeyName { get; }For one read by a name, what the name is, from the method’s parameter, e.g. “kind”; null for one that isn’t.
Member
Section titled “Member”public MemberInfo Member { get; }The property (or, for one read by a name, the method) it reads.
public string Name { get; }What it’s called, without spaces, e.g. “MovesLeft”.
OutOfName
Section titled “OutOfName”public string? OutOfName { get; }The property it’s out of (see OutOf), e.g. “TargetScore”; null for none.
QualifiedName
Section titled “QualifiedName”public string QualifiedName { get; }“MatchBoard.Score”: the component’s name and the output’s, which names it even on an entity where two components have one called the same.
Reference
Section titled “Reference”public string Reference { get; }How it’s written where it’s read: its name, or for one read by a name, its name and an example, e.g. “Amount:Gold”.
ValueKind
Section titled “ValueKind”public string ValueKind { get; }“a number”, “a whole number”, “true or false” or “a name”.
ValueType
Section titled “ValueType”public Type ValueType { get; }What it gives: Single, Int32, Boolean or String.
Methods
Section titled “Methods”IsCalled
Section titled “IsCalled”public bool IsCalled(ReadOnlySpan<char> name)True if name names it: its name or a former one (FormerNames), whatever the capitals and spaces (“moves left” is MovesLeft), or with its component’s in front (“MatchBoard.Score”). The name it’s read by (after a colon) isn’t part of it.
ReadNumber
Section titled “ReadNumber”public float ReadNumber(Component component, string? key = null)What it gives on component as a number: true is 1 and false 0, and a name 0. key is the name for one read by a name.
ReadOutOf
Section titled “ReadOutOf”public float ReadOutOf(Component component, string? key = null)What it’s out of on component (see OutOf); 0 for nothing.
ReadText
Section titled “ReadText”public string? ReadText(Component component, string? key = null)What it gives on component for one that gives a name; null for one that gives a number.
ToString
Section titled “ToString”public override string ToString()