Add better chat command handling, help, and option to set basic mod state.

This commit is contained in:
Ottermandias 2022-12-20 20:17:18 +01:00
parent 1ae96c71a3
commit 6f356105cc
7 changed files with 719 additions and 227 deletions

View file

@ -60,6 +60,15 @@ public sealed partial class ActorManager : IDisposable
public string ToWorldName(ushort worldId)
=> worldId == ushort.MaxValue ? "Any World" : Worlds.TryGetValue(worldId, out var name) ? name : "Invalid";
/// <summary>
/// Return the world id corresponding to the given name.
/// </summary>
/// <returns>ushort.MaxValue if the name is empty, 0 if it is not a valid world, or the worlds id.</returns>
public ushort ToWorldId(string worldName)
=> worldName.Length != 0
? Worlds.FirstOrDefault(kvp => string.Equals(kvp.Value, worldName, StringComparison.OrdinalIgnoreCase), default).Key
: ushort.MaxValue;
/// <summary>
/// Convert a given ID for a certain ObjectKind to a name.
/// </summary>