ComponentAction
namespace Griff.Scenes;
public sealed class ComponentActionOne thing a component does that anything can set off (see ActionAttribute): its name, what it’s done with, and the call itself, which allocates nothing.
Properties
Section titled “Properties”ComponentType
Section titled “ComponentType”public Type ComponentType { get; }The component type it belongs to.
DefaultValue
Section titled “DefaultValue”public object? DefaultValue { get; }What it’s done with when nothing says: the method’s default for the value if it has one, otherwise 1 for a number, true, or nothing for a name.
DisplayName
Section titled “DisplayName”public string DisplayName { get; }What it’s called with spaces between the words, e.g. “End Turn”.
FormerNames
Section titled “FormerNames”public IReadOnlyList<string> FormerNames { get; }Names it had before (FormerNameAttribute): what still names it.
Method
Section titled “Method”public MethodInfo Method { get; }The method it calls.
public string Name { get; }What it’s called, without spaces, e.g. “EndTurn”.
QualifiedName
Section titled “QualifiedName”public string QualifiedName { get; }“Health.Damage”: the component’s name and the action’s, which names it even on an entity where two components have one called the same.
TakesGame
Section titled “TakesGame”public bool TakesGame { get; }True if it needs a service of the game it runs in (it’s set off only while one runs).
ValueKind
Section titled “ValueKind”public string? ValueKind { get; }“a number”, “a whole number”, “true or false” or “a name”; null for one that takes no value.
ValueName
Section titled “ValueName”public string? ValueName { get; }What its value is, from the method’s parameter, e.g. “amount” or “flag”; null for one that takes none.
ValueNames
Section titled “ValueNames”public NamesAttribute? ValueNames { get; }For an action done with a name: what the name names, when its parameter is marked NamesAttribute (a trigger’s Set Flag a flag, its Load Scene a scene), so a trigger’s or button’s With picks from those; null otherwise.
ValueType
Section titled “ValueType”public Type? ValueType { get; }The kind of value it’s done with: Single, Int32, Boolean or String; null for one that takes none.
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 (“end turn” is EndTurn), or with its component’s in front (“Health.Damage”).
SameWords
Section titled “SameWords”public static bool SameWords(ReadOnlySpan<char> a, ReadOnlySpan<char> b)True if two names are the same, whatever their capitals and spaces.
Spaced
Section titled “Spaced”public static string Spaced(string name)A name written as words, the way the editor shows it: “EndTurn” as “End Turn”.
ToString
Section titled “ToString”public override string ToString()