public object Convert(ICommandContext context, ParameterQueue queue)
        {
            string parameter = queue.Dequeue();

            if (!parameter.StartsWith('"'))
            {
                return(parameter);
            }

            // concat parameters between quotes
            // "this will be passed as a single parameter"
            var sb = new StringBuilder();

            parameter = parameter.Substring(1);

            while (true)
            {
                if (parameter.EndsWith('"'))
                {
                    sb.Append(parameter.Substring(0, parameter.Length - 1));
                    break;
                }

                sb.Append(parameter);
                if (queue.Count == 0)
                {
                    break;
                }

                sb.Append(" ");
                parameter = queue.Dequeue();
            }

            return(sb.ToString());
        }
        public virtual object Convert(ICommandContext context, ParameterQueue queue)
        {
            string parameter = queue.Dequeue();

            if (!parameter.StartsWith('"'))
            {
                return(parameter);
            }

            // concat parameters between quotes
            // "this will be passed as a single parameter"
            var sb = new StringBuilder();

            parameter = parameter[1..];
 public object Convert(ICommandContext context, ParameterQueue queue)
 {
     return(ushort.Parse(queue.Dequeue()));
 }
 public object Convert(ICommandContext context, ParameterQueue queue)
 {
     return(new Vector3(float.Parse(queue.Dequeue()), float.Parse(queue.Dequeue()), float.Parse(queue.Dequeue())));
 }
Beispiel #5
0
 public object Convert(ICommandContext context, ParameterQueue queue)
 {
     return(Enum.Parse(typeof(T), queue.Dequeue()));
 }