diff options
| author | Sophia Pearson <codergal89@gmail.com> | 2022-11-26 10:08:44 +0100 |
|---|---|---|
| committer | Sophia Pearson <codergal89@gmail.com> | 2022-11-26 10:08:44 +0100 |
| commit | d7eefa488135c477f39ea0953b032c7dcdad8bc7 (patch) | |
| tree | d9725b73b342ff3d9df4d800616dd010b48c7222 /Scripts/Game/CommandParser.cs | |
| parent | 8e8a58bac339aa06e860b977670f16c8b4eb30a8 (diff) | |
| download | texty-d7eefa488135c477f39ea0953b032c7dcdad8bc7.tar.xz texty-d7eefa488135c477f39ea0953b032c7dcdad8bc7.zip | |
scripts: perform code cleanup actions
Diffstat (limited to 'Scripts/Game/CommandParser.cs')
| -rw-r--r-- | Scripts/Game/CommandParser.cs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Scripts/Game/CommandParser.cs b/Scripts/Game/CommandParser.cs index 9b02ee5..6c29545 100644 --- a/Scripts/Game/CommandParser.cs +++ b/Scripts/Game/CommandParser.cs @@ -2,22 +2,21 @@ using System.Linq; using Godot; using Texty.Scripts.Commands; -namespace Texty.Scripts.Game +namespace Texty.Scripts.Game; + +public partial class CommandParser : Node { - public partial class CommandParser : Node + public override void _Ready() { - public override void _Ready() - { - } + } - public Command TryParse(string text) + public Command TryParse(string text) + { + var components = text.Split(' '); + return components[0].ToLower() switch { - var components = text.Split(' '); - return components[0].ToLower() switch - { - "look" => new LookCommand(components.Skip(1).ToArray()), - _ => null - }; - } + "look" => new LookCommand(components.Skip(1).ToArray()), + _ => null + }; } }
\ No newline at end of file |
