/// <summary>Executes the list input part of the foreached command, without debug.</summary> /// <param name="queue">The command queue involved.</param> /// <param name="entry">Entry to be executed.</param> /// <param name="listItem">Dynamic tag to hold the item in the list.</param> public static bool TryForeachNumberedCIL_NoDebug(CommandQueue queue, CommandEntry entry, DynamicTag listItem) { ListTag list = ListTag.CreateFor(entry.GetArgumentObject(queue, 1)); if (list.Internal.Count == 0) { return(false); } entry.SetData(queue, new ForeachCommandData() { Index = 0, List = list.Internal }); listItem.Internal = list.Internal[0]; return(true); }
/// <summary>Executes the list input part of the foreached command.</summary> /// <param name="queue">The command queue involved.</param> /// <param name="entry">Entry to be executed.</param> /// <param name="listItem">Dynamic tag to hold the item in the list.</param> public static bool TryForeachNumberedCIL(CommandQueue queue, CommandEntry entry, DynamicTag listItem) { ListTag list = ListTag.CreateFor(entry.GetArgumentObject(queue, 1)); if (list.Internal.Count == 0) { if (entry.ShouldShowGood(queue)) { entry.GoodOutput(queue, "Not looping."); } return(false); } entry.SetData(queue, new ForeachCommandData() { Index = 0, List = list.Internal }); listItem.Internal = list.Internal[0]; if (entry.ShouldShowGood(queue)) { entry.GoodOutput(queue, "Looping " + TextStyle.Separate + list.Internal.Count + TextStyle.Base + " times..."); } return(true); }
/// <summary>Handles the base input for a tag.</summary> /// <param name="data">The tag data.</param> /// <returns>The correct object.</returns> public static ListTag HandleOne(TagData data) { return(ListTag.CreateFor(data.GetModifierObjectCurrent())); }