Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }