using System; using System.Collections.Generic; namespace VibranceHud; public static class TolerantOutputBuilder { public static List Build(int outputCount, Action build, Action? onError = null) { if (build == null) { throw new ArgumentNullException("build"); } List list = new List(); for (int i = 0; i < outputCount; i++) { try { build(i); list.Add(i); } catch (Exception arg) { try { onError?.Invoke(i, arg); } catch { } } } return list; } }