private static IEnumerator <RichActionBase> OutputPrint(Sandbox sb, RantObject that,
                                                         [RichardPropertyArgument("object", "any", Description = "The object to print.")]
                                                         RantObject obj)
 {
     sb.Print(obj.ToString());
     yield break;
 }
 private static IEnumerator <RichActionBase> ConvertToString(Sandbox sb, RantObject that,
                                                             [RichardPropertyArgument("object", "any", Description = "The object to convert to a string.")]
                                                             RantObject obj)
 {
     sb.ScriptObjectStack.Push(obj.ToString());
     yield break;
 }
        private static IEnumerator <RantAction> ListJoin(Sandbox sb, RantObject that,
                                                         [RichardPropertyArgument("seperator", "string", Description = "The string to seperate each item of the list.")]
                                                         RantObject obj)
        {
            yield return(that.Value as RichList);

            var list = sb.ScriptObjectStack.Pop();

            sb.ScriptObjectStack.Push(string.Join(obj.ToString(), (list as RichList).Items.Select(item => item.ToString()).ToArray()));
            yield break;
        }
        private static IEnumerator <RichActionBase> ConvertToNumber(Sandbox sb, RantObject that,
                                                                    [RichardPropertyArgument("object", "any", Description = "The object to convert to a number.")]
                                                                    RantObject obj)
        {
            string val = obj.ToString();
            double n;

            if (!Util.ParseDouble(val, out n))
            {
                sb.ScriptObjectStack.Push(new RantObject());
            }
            sb.ScriptObjectStack.Push(n);
            yield break;
        }