Example #1
0
        private String argumentsParse(String args, DataSources dataSources)
        {
            APIEntry currentEntry = null;
            var      APIResults   = new Dictionary <string, object>();

            String[] argsSplit = args.Split(ARGUMENTS_DELIMETER);

            foreach (String arg in argsSplit)
            {
                string refArg = arg;
                PluginLogger.fine(refArg);
                kspAPI.parseParams(ref refArg, ref dataSources);
                currentEntry = argumentParse(refArg, dataSources);
                APIResults[dataSources.getVarName()] = currentEntry.formatter.prepareForSerialization(currentEntry.function(dataSources));

                //Only parse the paused argument if the active vessel is null
                if (dataSources.vessel == null)
                {
                    break;
                }
            }

            return(SimpleJson.SimpleJson.SerializeObject(APIResults));
        }
        private String argumentsParse(String args, DataSources dataSources)
        {
            APIEntry      currentEntry = null;
            List <string> APIResults   = new List <string>();

            String[] argsSplit = args.Split(ARGUMENTS_DELIMETER);

            foreach (String arg in argsSplit)
            {
                string refArg = arg;
                PluginLogger.fine(refArg);
                kspAPI.parseParams(ref refArg, ref dataSources);
                currentEntry = argumentParse(refArg, dataSources);
                APIResults.Add(currentEntry.formatter.format(currentEntry.function(dataSources)));

                //Only parse the paused argument if the active vessel is null
                if (dataSources.vessel == null)
                {
                    break;
                }
            }

            return(currentEntry.formatter.pack(APIResults));
        }