LetterCountsAttribute
namespace Griff.Scenes;
public sealed class LetterCountsAttribute : FieldEditorAttributeMarks a string property as letters, each from a set and each as many times as it comes: a falling-block board’s pieces, “IJLOSTZ” (each once) or “IIO” (twice as many I’s). The Inspector has a count for each letter, with its picture.
Properties
Section titled “Properties”public string? Cells { get; init; }A static method of the component taking a letter (a char) and giving the cells of its picture, (x, y) pairs, y up: a piece’s shape. Null for none.
Letters
Section titled “Letters”public string Letters { get; }The letters there are, in order.
public string Noun { get; init; }What they are, e.g. “pieces”, for the descriptions.
Methods
Section titled “Methods”CellsOf
Section titled “CellsOf”public IReadOnlyList<ValueTuple<int, int>> CellsOf(Component component, char letter)The cells of letter’s picture on component’s type, or none.
Describe
Section titled “Describe”public override string Describe()Problem
Section titled “Problem”public override string? Problem(Component component, object? value)public IReadOnlyList<int> Read(string? text)How many times each letter comes in text.
public string Write(IReadOnlyList<int> counts)The text for counts, a count for each letter in order: “IJLOSTZ”, “IIO”.