diff options
Diffstat (limited to 'Scripts/Game/CommandParser.cs')
| -rw-r--r-- | Scripts/Game/CommandParser.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Scripts/Game/CommandParser.cs b/Scripts/Game/CommandParser.cs new file mode 100644 index 0000000..5f8249a --- /dev/null +++ b/Scripts/Game/CommandParser.cs @@ -0,0 +1,23 @@ +using System.Linq; +using Godot; +using Texty.Scripts.Commands; + +namespace Texty.Scripts.Game +{ + public class CommandParser : Node + { + public override void _Ready() + { + } + + public Command TryParse(string text) + { + var components = text.Split(' '); + return components[0].ToLower() switch + { + "look" => new LookCommand(components.Skip(1).ToArray()), + _ => null + }; + } + } +}
\ No newline at end of file |
