public static StellarClass ResolveStellarClass( Random random, string typeStr, string subTypeStr, string sizeStr) { StellarType type; if (!StellarClass.TryParseType(typeStr, out type)) { type = StarHelper.ChooseStellarType(random); } int subtype; if (!StellarClass.TryParseSubType(subTypeStr, out subtype)) { subtype = StarHelper.ChooseStellarSubType(random); } StellarSize size; if (!StellarClass.TryParseSize(sizeStr, out size)) { size = StarHelper.ChooseStellarSize(random, type, subtype); } return(new StellarClass(type, subtype, size)); }
public static StellarClass ChooseStellarClass(Random random) { StellarType type = StarHelper.ChooseStellarType(random); int subtype = StarHelper.ChooseStellarSubType(random); StellarSize size = StarHelper.ChooseStellarSize(random, type, subtype); return(new StellarClass(type, subtype, size)); }