RowsAttribute
namespace Griff.Scenes;
public abstract class RowsAttribute : FieldEditorAttributeMarks a property as a list of rows, each of a few cells (a RowColumn each): items and how many, a tile and what it drops, a position’s name and where it is. The property is a string, its rows separated by commas (or what Separators says), or a list of strings, a row each. The Inspector lists the rows with a box, picker or number for each cell, to set, add, remove and reorder; agents set them the same way (each row’s cells by column name).
Properties
Section titled “Properties”Columns
Section titled “Columns”public abstract IReadOnlyList<RowColumn> Columns { get; }The columns of each row, in order.
ColumnsText
Section titled “ColumnsText”protected string ColumnsText { get; }“Rows of an item and how many”: the columns, for Describe.
Example
Section titled “Example”public abstract string Example { get; }A row as it’s written, for what’s wrong with one, e.g. “Coin 3”.
FitsText
Section titled “FitsText”public override string FitsText { get; }Joiner
Section titled “Joiner”protected virtual string Joiner { get; }What a string’s rows are joined with.
public abstract string Noun { get; }What a row is, “an item” or “a recipe”: for its Add button and for what’s wrong with one.
public bool One { get; init; }It holds one row at most (a single difficulty): the Inspector shows its cells with nothing to add or remove.
Separators
Section titled “Separators”protected virtual char[] Separators { get; }What separates a string’s rows: commas and semicolons unless it says.
Methods
Section titled “Methods”public static ValueTuple<string, string>? Colon(string row)“name: text” split at its first colon, both trimmed; null without one, or with nothing before it.
public override bool Fits(Type type)IsNumber
Section titled “IsNumber”public static bool IsNumber(string? text)True when text reads as a number.
IsWhole
Section titled “IsWhole”public static bool IsWhole(string? text)True when text reads as a whole number.
MoreChoices
Section titled “MoreChoices”public virtual IReadOnlyList<string> MoreChoices(int column, Component component, IProjectNames? names)What else column column’s cells offer on component, besides the project’s names and Choices: a character’s clips with the pictures, the difficulties the charts have.
NameCount
Section titled “NameCount”public static ValueTuple<string, int> NameCount(string text)“Coin 3” read as a name and how many after it (1 when it doesn’t say); “Coin” is (“Coin”, 1).
public IEnumerable<ValueTuple<NamesAttribute, string>> Named(object? value)Each name value’s cells give of what Names says (an amounts cell’s each), with what it names: the names a column that defines them adds to the project’s (an item given, a resource had).
NewRow
Section titled “NewRow”public virtual IReadOnlyList<string> NewRow()A new row’s cells, as Add puts on the end.
public virtual string? Note(Component component, IReadOnlyList<string> cells, IProjectNames? names)A word under row cells about what it does now, e.g. “Chart: the First Light table” or “No table is called First Light”; null for none.
Number
Section titled “Number”public static string Number(double value)A number as a cell holds it: invariant, on hundredths.
Problem
Section titled “Problem”public override string? Problem(Component component, object? value)public abstract IReadOnlyList<string>? Read(string row)A row’s cells, a string each, as many as Columns; null when it doesn’t read.
public IReadOnlyList<string> Rows(object? value)The rows value holds, as written, blank ones left out.
public object? Store(IEnumerable<string> rows, Type type)The value holding rows, for a property of type: joined, or a list.
public abstract string Write(IReadOnlyList<string> cells)A row written from its cells, as the field holds it.