public static float GetWeight(StructOption structOption, Dictionary <string, int> structCount) { bool containKey = structCount.ContainsKey(structOption.structureLayoutTag); if (containKey) { int count = structCount.TryGetValue(structOption.structureLayoutTag); if (count < structOption.minCount) { return(2f); } else if (structOption.maxCount != -1 && count == structOption.maxCount) { return(0f); } else { return(1f); } } else { return(3f); } }
public override IEnumerable <string> ConfigErrors() { foreach (string str in allowedStructures) { allowedStructuresConverted.Add(StructOption.FromString(str)); } return(base.ConfigErrors()); }