public override List <Feature> Collect(int level, IChoiceProvider choiceProvider, OGLContext context) { if (Level > level) { return(new List <Feature>()); } int offset = choiceProvider.GetChoiceOffset(this, UniqueID, Amount); List <Feature> res = new List <Feature>() { this }; for (int c = 0; c < Amount; c++) { String counter = ""; if (c + offset > 0) { counter = "_" + (c + offset).ToString(); } Choice cho = choiceProvider.GetChoice(UniqueID + counter); if (cho != null && cho.Value != "") { Feature feat = context.GetFeatureCollection(Collection, AllowSameChoice ? c : 0).Find(fe => fe.Name + " " + ConfigManager.SourceSeperator + " " + fe.Source == cho.Value); if (feat == null) { feat = context.GetFeatureCollection(Collection, AllowSameChoice ? c : 0).Find(fe => ConfigManager.SourceInvariantComparer.Equals(fe.Name + " " + ConfigManager.SourceSeperator + " " + fe.Source, cho.Value)); } if (feat != null) { res.AddRange(feat.Collect(level, choiceProvider, context)); } else { ConfigManager.LogError("Missing Feature: " + cho.Value + " in " + Collection); } } } return(res); }