private string CmdDta(List <string> args, ConsoleBehaviour console) { var datumName = args[0]; if (!_dataBindings.DatumIsRegistered(datumName)) { return(DatumNotFound(datumName)); } return(_dataBindings.GetDatum(datumName)); }
private string CmdPlot(List <string> arg1, ConsoleBehaviour arg2) { var x = int.Parse(arg1[0]); var y = int.Parse(arg1[1]); var z = int.Parse(arg1[2]); var target = new Vector3Int(x, y, z); GameManager.Instance.GameState.PlayerData.SpaceShipData.Heading = target; return("Plotted course to " + target); }
public string Execute(string[] parameters, ConsoleBehaviour console) { var args = parameters.ToList(); args.RemoveRange(0, 1); if (args.Count < MinParameterCount) { return(FailNotEnoughArguments(args.Count)); } return(CommandFunction.Invoke(args, console)); }
public string ExecuteCommand(string commandBuffer, ConsoleBehaviour console) { var parameters = commandBuffer.Split(' '); if (parameters[0].Equals(String.Empty)) { return(FailNoCommandFound()); } var cmd = parameters[0].ToLower(); if (!_commandData.ContainsKey(cmd)) { return(NoSuchCommand(cmd)); } return(_commandData[cmd].Execute(parameters, console)); }
private string CmdStop(List <string> arg1, ConsoleBehaviour arg2) { var startables = GameManager.Instance.Startables; var name = arg1[0]; if (!startables.ContainsKey(name)) { return($"ERROR: Did not find {name}."); } var startable = startables[name]; if (!startable.IsRunning()) { return($"WARN: {name} not running."); } startables[name].Stop(); return($"Stopped {name}."); }
private string CmdScan(List <string> arg1, ConsoleBehaviour arg2) { var target = arg1[0]; return("WIP"); }
private string CmdCls(List <string> args, ConsoleBehaviour console) { console.ClearScreen(); return("0"); }
private string CmdEcho(List <string> args, ConsoleBehaviour console) { return(String.Join(" ", args)); }