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 }; } } }