コード例 #1
0
 public static IEnumerable <IStellarEntity> CreateStar(
     Random random,
     StarOrbit orbiterParams)
 {
     StellarClass.Parse(orbiterParams.StellarClass);
     return((IEnumerable <IStellarEntity>) new IStellarEntity[1]
     {
         (IStellarEntity) new StellarEntity()
         {
             Params = (Kerberos.Sots.Data.StarMapFramework.Orbit)orbiterParams
         }
     });
 }
コード例 #2
0
        private static float CalcRadius(Kerberos.Sots.Data.StarMapFramework.Orbit orbital)
        {
            if (orbital is StarOrbit)
            {
                return(StarSystemVars.Instance.StarRadius(StellarClass.Parse((orbital as StarOrbit).StellarClass).Size));
            }
            PlanetInfo planetInfo = StarSystemHelper.InferPlanetInfo(orbital);

            if (planetInfo != null)
            {
                return(StarSystemVars.Instance.SizeToRadius(planetInfo.Size));
            }
            throw new ArgumentException("unexpected type");
        }
コード例 #3
0
 private static List <Kerberos.Sots.Data.StarMapFramework.Orbit> PopulateRandomOrbitsCore(
     Random random,
     Kerberos.Sots.Data.StarMapFramework.Orbit parentOrbital)
 {
     if (parentOrbital is StarOrbit)
     {
         StellarClass stellarClass = StellarClass.Parse((parentOrbital as StarOrbit).StellarClass);
         return(StarHelper.ChooseOrbitContents(random, stellarClass).ToList <Kerberos.Sots.Data.StarMapFramework.Orbit>());
     }
     if (parentOrbital is GasGiantLargeOrbit)
     {
         return(GasGiantHelper.ChooseOrbitContents(random).ToList <Kerberos.Sots.Data.StarMapFramework.Orbit>());
     }
     if (parentOrbital is GasGiantSmallOrbit)
     {
         return(GasGiantHelper.ChooseOrbitContents(random).ToList <Kerberos.Sots.Data.StarMapFramework.Orbit>());
     }
     return(new List <Kerberos.Sots.Data.StarMapFramework.Orbit>());
 }