Skip to content

NameListAttribute

namespace Griff.Scenes;
public sealed class NameListAttribute : FieldEditorAttribute

Marks a property as a list of names in order: a string separated by commas (a turn order’s “Player, Enemy”) or a list of strings, one a line (a choice’s options). The Inspector lists them a row each, to rename, add, take out and move up; a name given twice is flagged.

public override string FitsText { get; }
public int Least { get; init; }

The fewest there can be: taking one out stops there.

public string Noun { get; init; }

What each name is, e.g. “side” or “option”, for the Inspector’s buttons and the descriptions.

public override string Describe()
public override bool Fits(Type type)
public override string? Problem(Component component, object? value)
public static IReadOnlyList<string> Read(object? value)

The names a value holds, in order, blank ones left out.