Beispiel #1
0
 private static void PrintEmoji(Sandbox sb,
                                [RantDescription("The emoji shortcode to use, without colons.")]
                                string shortcode)
 {
     shortcode = shortcode.ToLower();
     if (!Emoji.Shortcodes.ContainsKey(shortcode))
     {
         sb.Print("[missing emoji]");
         return;
     }
     sb.Print(Char.ConvertFromUtf32(Emoji.Shortcodes[shortcode]));
 }
 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;
 }
Beispiel #3
0
 private static void Number(Sandbox sb,
                            [RantDescription("The minimum value of the number to generate.")]
                            int min,
                            [RantDescription("The maximum value of the number to generate.")]
                            int max)
 {
     sb.Print(sb.RNG.Next(min, max + 1));
 }
Beispiel #4
0
        private static void Number(Sandbox sb,
                                   [RantDescription("The string to convert into a number.")]
                                   string input)
        {
            double number;

            sb.Print(double.TryParse(input, out number) ? number : 0);
        }
Beispiel #5
0
 private static void RepElapsed(Sandbox sb)
 {
     if (!sb.Blocks.Any())
     {
         return;
     }
     sb.Print(sb.Blocks.Peek().Iteration - 1);
 }
Beispiel #6
0
 private static void RepCount(Sandbox sb)
 {
     if (!sb.Blocks.Any())
     {
         return;
     }
     sb.Print(sb.Blocks.Peek().Count);
 }
Beispiel #7
0
 private static void IndexOne(Sandbox sb)
 {
     if (!sb.Blocks.Any())
     {
         return;
     }
     sb.Print(sb.Blocks.Peek().Index + 1);
 }
Beispiel #8
0
 private static void Match(Sandbox sb)
 {
     if (!sb.RegexMatches.Any())
     {
         return;
     }
     sb.Print(sb.RegexMatches.Peek().Value);
 }
Beispiel #9
0
 private static void Group(Sandbox sb,
                           [RantDescription("The name of the match group whose value will be retrieved.")]
                           string groupName)
 {
     if (!sb.RegexMatches.Any())
     {
         return;
     }
     sb.Print(sb.RegexMatches.Peek().Groups[groupName].Value);
 }
Beispiel #10
0
        private static void RepQueued(Sandbox sb)
        {
            if (!sb.Blocks.Any())
            {
                return;
            }
            var block = sb.Blocks.Peek();

            sb.Print(block.Count - (block.Iteration - 1));
        }
Beispiel #11
0
 private static void Bullet(Sandbox sb) => sb.Print("\x2022");
Beispiel #12
0
 private static void Eszett(Sandbox sb) => sb.Print("\x00df");
Beispiel #13
0
 private static void Endash(Sandbox sb) => sb.Print("\x2013");
Beispiel #14
0
 private static void Copyright(Sandbox sb) => sb.Print("\x00a9");
Beispiel #15
0
 private static void Trademark(Sandbox sb) => sb.Print("\x2122");
Beispiel #16
0
 private static void Match(Sandbox sb)
 {
     if (!sb.RegexMatches.Any()) return;
     sb.Print(sb.RegexMatches.Peek().Value);
 }
Beispiel #17
0
 private static void Depth(Sandbox sb)
 {
     sb.Print(sb.Blocks.Count);
 }
Beispiel #18
0
 private static void Copyright(Sandbox sb) => sb.Print("\x00a9");
Beispiel #19
0
 private static void RegisteredTrademark(Sandbox sb) => sb.Print("\x00ae");
Beispiel #20
0
 private static void Emdash(Sandbox sb) => sb.Print("\x2014");
Beispiel #21
0
 private static void Endash(Sandbox sb) => sb.Print("\x2013");
Beispiel #22
0
 private static void Plural(Sandbox sb, string word)
 {
     sb.Print(sb.Format.Pluralizer.Pluralize(word));
 }
Beispiel #23
0
 private static void RepCount(Sandbox sb)
 {
     if (!sb.Blocks.Any()) return;
     sb.Print(sb.Blocks.Peek().Count);
 }
Beispiel #24
0
 private static void Depth(Sandbox sb)
 {
     sb.Print(sb.Blocks.Count);
 }
Beispiel #25
0
 private static void RepQueued(Sandbox sb)
 {
     if (!sb.Blocks.Any()) return;
     var block = sb.Blocks.Peek();
     sb.Print(block.Count - (block.Iteration - 1));
 }
Beispiel #26
0
 private static void Trademark(Sandbox sb) => sb.Print("\x2122");
Beispiel #27
0
 private static void IndexOne(Sandbox sb)
 {
     if (!sb.Blocks.Any()) return;
     sb.Print(sb.Blocks.Peek().Index + 1);
 }
Beispiel #28
0
 private static void Number(Sandbox sb,
     [RantDescription("The minimum value of the number to generate.")]
     int min,
     [RantDescription("The maximum value of the number to generate.")]
     int max)
 {
     sb.Print(sb.RNG.Next(min, max + 1));
 }
Beispiel #29
0
 private static void Group(Sandbox sb,
     [RantDescription("The name of the match group whose value will be retrieved.")]
     string groupName)
 {
     if (!sb.RegexMatches.Any()) return;
     sb.Print(sb.RegexMatches.Peek().Groups[groupName].Value);
 }
Beispiel #30
0
	    private static void GetTargetValue(Sandbox sb,
            [RantDescription("The name of the target whose value to print.")]
	        string targetName)
	    {
	        sb.Print(sb.CurrentOutput.GetActiveChannel().GetTargetValue(targetName));
	    }
Beispiel #31
0
 private static void RegisteredTrademark(Sandbox sb) => sb.Print("\x00ae");
Beispiel #32
0
	    private static void Len(Sandbox sb, 
			[RantDescription("The channel for which to retrieve the length.")]
			string channelName)
	    {
		    sb.Print(sb.Output.GetChannelLength(channelName));
	    }
Beispiel #33
0
 private static void Emdash(Sandbox sb) => sb.Print("\x2014");
Beispiel #34
0
 private static void Number(Sandbox sb,
     [RantDescription("The string to convert into a number.")]
     string input)
 {
     double number;
     sb.Print(double.TryParse(input, out number) ? number : 0);
 }
Beispiel #35
0
 private static void Bullet(Sandbox sb) => sb.Print("\x2022");
Beispiel #36
0
 private static void RepElapsed(Sandbox sb)
 {
     if (!sb.Blocks.Any()) return;
     sb.Print(sb.Blocks.Peek().Iteration - 1);
 }
Beispiel #37
0
 private static void PrintEmoji(Sandbox sb, 
     [RantDescription("The emoji shortcode to use, without colons.")]
     string shortcode)
 {
     shortcode = shortcode.ToLower();
     if(!Emoji.Shortcodes.ContainsKey(shortcode))
     {
         sb.Print("[missing emoji]");
         return;
     }
     sb.Print(Char.ConvertFromUtf32(Emoji.Shortcodes[shortcode]));
 }
Beispiel #38
0
 private static void Eszett(Sandbox sb) => sb.Print("\x00df");
Beispiel #39
0
	    private static void Plural(Sandbox sb, string word)
	    {
		    sb.Print(sb.Format.Pluralizer.Pluralize(word));
	    }
Beispiel #40
0
 private static void Len(Sandbox sb,
                         [RantDescription("The channel for which to retrieve the length.")]
                         string channelName)
 {
     sb.Print(sb.Output.GetChannelLength(channelName));
 }