Exemplo n.º 1
0
        private static void AssignOrbitNumbers(StellarClass stellarClass, List <Kerberos.Sots.Data.StarMapFramework.Orbit> orbitals)
        {
            int orbitNumber = StarHelper.CalcMinOrbit(stellarClass);

            foreach (Kerberos.Sots.Data.StarMapFramework.Orbit orbit in orbitals.Where <Kerberos.Sots.Data.StarMapFramework.Orbit>((Func <Kerberos.Sots.Data.StarMapFramework.Orbit, bool>)(x => x.OrbitNumber < 1)))
            {
                while (orbitals.Any <Kerberos.Sots.Data.StarMapFramework.Orbit>((Func <Kerberos.Sots.Data.StarMapFramework.Orbit, bool>)(x => x.OrbitNumber == orbitNumber)))
                {
                    ++orbitNumber;
                }
                orbit.OrbitNumber = orbitNumber;
                ++orbitNumber;
            }
        }
Exemplo n.º 2
0
        private static Range <int> ChooseOrbits(Random random, StellarClass stellarClass)
        {
            Range <int> range = new Range <int>(0, 0);
            int         num   = StarHelper.ChooseOrbitCount(random, stellarClass);

            if (num <= 0)
            {
                return(range);
            }
            int max = num;
            int min = StarHelper.CalcMinOrbit(stellarClass);

            if (min > max)
            {
                return(range);
            }
            return(new Range <int>(min, max));
        }