namespace AIStudio.Assistants.BeyondFactsLab; /// /// What the BeyondFacts Lab shows and allows for a mode of the simulation in the step "Test situation". /// public static class BflSimulationModeExtensions { private static string TB(string fallbackEN) => Tools.PluginSystem.I18N.I.T(fallbackEN, typeof(BflSimulationModeExtensions).Namespace, nameof(BflSimulationModeExtensions)); /// The mode. extension(BflSimulationMode mode) { /// /// Gets the name of the mode, as the selection shows it. /// public string Title => mode switch { BflSimulationMode.SINGLE_PERSON => TB("One person from the research"), BflSimulationMode.PANEL_DISCUSSION => TB("Panel discussion with up to three people"), BflSimulationMode.PRESS_CONFERENCE => TB("Press conference with up to five people"), _ => TB("Generic counterparts, no specific person"), }; /// /// Gets how many people from the research the chat plays at most in this mode; none for generic counterparts. /// public int MaxPeople => mode switch { BflSimulationMode.SINGLE_PERSON => 1, BflSimulationMode.PANEL_DISCUSSION => 3, BflSimulationMode.PRESS_CONFERENCE => 5, _ => 0, }; /// /// Gets whether the chat plays people from the research in this mode. /// public bool HasPeople => mode.MaxPeople > 0; /// /// Gets the stem of the file which describes the simulation of the mode, see BflPromptLibrary.SimulationPath. /// Generic counterparts need no file of their own: the prompt of the step describes them. /// public string FileStem => mode switch { BflSimulationMode.SINGLE_PERSON => "single-person", BflSimulationMode.PANEL_DISCUSSION => "panel-discussion", BflSimulationMode.PRESS_CONFERENCE => "press-conference", _ => throw new ArgumentOutOfRangeException(nameof(mode), mode, "The mode has no file of its own."), }; /// /// Gets every mode, in the order the selection shows them. /// public static IReadOnlyList All => Enum.GetValues(); } }