blob: 9b02ee544004fc16d00402cefbdc760310b66192 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
using System.Linq;
using Godot;
using Texty.Scripts.Commands;
namespace Texty.Scripts.Game
{
public partial 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
};
}
}
}
|