// ============================================================================ // RynthVision - VisionCommands.cs // The /rv chat command's words and what it answers (2026-10-28: every // command answers in chat, Plugins/Shared/CommandReply.cs). "/rv light ..." // is Light/DungeonLight.cs's. Pure, so RynthVision.Tests checks every verb. // ============================================================================ using RynthCore.Plugin.Shared; namespace RynthCore.Plugin.RynthVision; internal enum VisionVerb { Status, Radar, Slopes, Water, WaterTypes, Debug, Light, Unknown } internal static class VisionCommands { public const string Usage = "/rv [radar | slopes | water] (show or hide) | watertypes | debug | light ... (/rv light help)"; /// The words after "/rv" (lower case): the verb, and for light what follows it. public static VisionVerb Parse(string arg, out string lightArgs) { lightArgs = string.Empty; string a = (arg ?? string.Empty).Trim().ToLowerInvariant(); if (a == "light" || a.StartsWith("light ", System.StringComparison.Ordinal)) { lightArgs = a.Substring(5); return VisionVerb.Light; } return a switch { "" => VisionVerb.Status, "radar" => VisionVerb.Radar, "slopes" => VisionVerb.Slopes, "water" => VisionVerb.Water, "watertypes" => VisionVerb.WaterTypes, "debug" => VisionVerb.Debug, _ => VisionVerb.Unknown, }; } /// The overlay a verb switches: its name in chat. public static string OverlayName(VisionVerb verb) => verb switch { VisionVerb.Radar => "Radar ring", VisionVerb.Slopes => "Unclimbable slopes", VisionVerb.Water => "Impassable water", _ => verb.ToString(), }; /// "/rv radar": the overlay's new state. public static string Switched(VisionVerb verb, bool on) => $"{OverlayName(verb)} {CommandReply.OnOff(on)}."; /// "/rv" alone: the overlays' state and the usage. public static string State(bool radar, bool slopes, bool water) => $"Radar ring {CommandReply.OnOff(radar)}, unclimbable slopes {CommandReply.OnOff(slopes)}, impassable water {CommandReply.OnOff(water)}. {Usage}"; /// "/rv debug": the pose stream's new state. public static string Debug(bool on) => $"Debug {CommandReply.OnOff(on)} (the player's pose and the overlays' landblock lines go to the log)."; /// A word /rv doesn't know. public static string Unknown(string arg) => $"Unknown '/rv {(arg ?? string.Empty).Trim()}'. Usage: {Usage}"; }