Skip to content

ChoicesOfAttribute

namespace Griff.Scenes;
public sealed class ChoicesOfAttribute : FieldEditorAttribute

Marks a string property as several names picked from what another member of its component lists (an AI fighter’s Use Moves, from its fighter’s moves), separated by commas: the Inspector ticks them from a list, and flags a name that isn’t one.

public string Member { get; }

The member of the component that lists the choices.

public string? None { get; init; }

What none ticked means, e.g. “every one”.

public string? Noun { get; init; }

What the choices are, for component_describe, e.g. “its fighter’s moves”.

public IReadOnlyList<string> Choices(Component component)

What component lists to pick from now.

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

The names value holds, in order.