public static ThingDef GetRandomChaomorph(ChaomorphType type) { float rN = Rand.Range(0, _totals[((int)type)]); ThingDef selectedChaomorph = null; foreach (ThingDef chaomorph in _randomChaomorphArrCache[((int)type)]) { var ext = _cachedExtensions[chaomorph]; if (rN <= ext.selectionWeight) { selectedChaomorph = chaomorph; break; } rN -= ext.selectionWeight; } return(selectedChaomorph); }
public static IReadOnlyList <ThingDef> GetChaomorphs(ChaomorphType type) { return(_chaomorphArr[(int)type]); }