Esempio n. 1
0
        public void GetPlanetInSystem(int x, int y, int planetindex, ref CPlanet planet)
        {
            CStar star = null;

            GetStarAtLocation(x, y, ref star);
            star.GetPlanet(planetindex, ref planet);
        }
Esempio n. 2
0
        public SolarSystem(int X, int Y, Universe here)
        {
            // Get the system data here in the constructor
            // to avoid passing our (huge) galaxy object into yet another sub routine.
            CStar star = null;

            bool[] orbits      = new bool[8];
            int[]  PlanetTypes = new int[8];

            for (int i = 0; i < 8; i++)
            {
                orbits[i]  = false;
                Planets[i] = null;
            }

            here.GetStarAtLocation(X, Y, ref star);

            if (star != null)
            {
                for (int i = 0; i < star.NumberOfPlanets; i++)
                {
                    CPlanet planet = null;
                    int     orbitnum;

                    star.GetPlanet(i, ref planet);
                    orbitnum = planet.Orbit;

                    orbits[orbitnum - 1]     = true;
                    Planets[orbitnum - 1]    = planet;
                    planetrefs[orbitnum - 1] = i;
                }
            }

            EllipsePoints();
            SetplanetXY();

            for (int i = 0; i < 8; i++)
            {
                if (orbits[i])
                {
                    picframe[i]   = GetPicFrame(Planets[i].PClass); //PlanetTypes(i)) 'We have a planet, get it's picture
                    planethere[i] = true;
                }
                else
                {
                    planethere[i] = false;
                }
            }
        }