From be8b65da15803af614250027bfb131a05ada4c45 Mon Sep 17 00:00:00 2001 From: ben_pollard Date: Fri, 6 Dec 2024 22:12:31 +0000 Subject: [PATCH] Changed exit examination to be more concise --- NetAF/Assets/Locations/Exit.cs | 2 +- NetAF/Interpretation/SceneCommandInterpreter.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NetAF/Assets/Locations/Exit.cs b/NetAF/Assets/Locations/Exit.cs index 27031e0e..beeb4fbd 100644 --- a/NetAF/Assets/Locations/Exit.cs +++ b/NetAF/Assets/Locations/Exit.cs @@ -61,7 +61,7 @@ public Exit(Direction direction, bool isLocked = false, Identifier identifier = /// The completed Description. private IDescription GenerateDescription() { - return new ConditionalDescription($"The exit {Direction.ToString().ToLower()} is locked.", $"The exit {Direction.ToString().ToLower()} is unlocked.", () => IsLocked); + return new ConditionalDescription($"{Identifier.Name} is locked.", $"{Identifier.Name} is unlocked.", () => IsLocked); } /// diff --git a/NetAF/Interpretation/SceneCommandInterpreter.cs b/NetAF/Interpretation/SceneCommandInterpreter.cs index 527743b8..f36cbde4 100644 --- a/NetAF/Interpretation/SceneCommandInterpreter.cs +++ b/NetAF/Interpretation/SceneCommandInterpreter.cs @@ -318,10 +318,10 @@ private static bool TryParseUseOnCommand(string text, Game game, out ICommand co if (noun.CaseInsensitiveContains(onPadded)) { - itemName = noun.Substring(0, noun.IndexOf(onPadded, StringComparison.CurrentCultureIgnoreCase)); + itemName = noun[..noun.IndexOf(onPadded, StringComparison.CurrentCultureIgnoreCase)]; noun = noun.Replace(itemName, string.Empty); var onIndex = noun.IndexOf(onPadded, StringComparison.CurrentCultureIgnoreCase); - var targetName = noun.Substring(onIndex + onPadded.Length); + var targetName = noun[(onIndex + onPadded.Length)..]; if (targetName.InsensitiveEquals(Me) || targetName.EqualsExaminable(game.Player)) target = game.Player;