Esempio n. 1
0
        private string CmdDta(List <string> args, ConsoleBehaviour console)
        {
            var datumName = args[0];

            if (!_dataBindings.DatumIsRegistered(datumName))
            {
                return(DatumNotFound(datumName));
            }

            return(_dataBindings.GetDatum(datumName));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        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}.");
        }
Esempio n. 6
0
        private string CmdScan(List <string> arg1, ConsoleBehaviour arg2)
        {
            var target = arg1[0];

            return("WIP");
        }
Esempio n. 7
0
 private string CmdCls(List <string> args, ConsoleBehaviour console)
 {
     console.ClearScreen();
     return("0");
 }
Esempio n. 8
0
 private string CmdEcho(List <string> args, ConsoleBehaviour console)
 {
     return(String.Join(" ", args));
 }