From 86053cb949eeef72760a02483b1494d82dd7a974 Mon Sep 17 00:00:00 2001 From: ruri Date: Fri, 12 Apr 2019 09:07:32 +0200 Subject: [PATCH] Added the Length function to the List group in Utility block. --- RuriLib/Blocks/BlockUtility.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/RuriLib/Blocks/BlockUtility.cs b/RuriLib/Blocks/BlockUtility.cs index ce8fdd0..4d09630 100644 --- a/RuriLib/Blocks/BlockUtility.cs +++ b/RuriLib/Blocks/BlockUtility.cs @@ -46,6 +46,9 @@ namespace RuriLib /// Creates an empty list variable. Create, + /// Calculates the length of a list. + Length, + /// Joins a list into a single string, separating the elements with a separator. Join, @@ -409,6 +412,10 @@ namespace RuriLib data.Variables.Set(new CVar(variableName, new List(), isCapture)); break; + case ListAction.Length: + data.Variables.Set(new CVar(variableName, list.Count().ToString(), isCapture)); + break; + case ListAction.Join: data.Variables.Set(new CVar(variableName, string.Join(separator, list), isCapture)); break;