Beispiel #1
0
        public void Initialise()
        {
            for (int z = 0; z < GridId.gridzrange; z++)
            {
                for (int x = 0; x < GridId.gridxrange; x++)
                {
                    int   id = GridId.IdFromComponents(x, z);
                    float xp = 0, zp = 0;
                    bool  ok = GridId.XZ(id, out xp, out zp);
                    Debug.Assert(ok);
                    StarGrid grd = new StarGrid(id, xp, zp, Color.Transparent, 1.0F); //A=0 means use default colour array
                    if (xp == 0 && zp == 0)                                           // sol grid, unpopulated stars please
                    {
                        grd.dBAsk = SystemClassDB.SystemAskType.UnPopulatedStars;
                    }

                    grids.Add(grd);
                }
            }

            systemlistgrid = new StarGrid(-1, 0, 0, Color.Orange, 1.0F);    // grid ID -1 means it won't be filled by the Update task
            grids.Add(systemlistgrid);

            int solid = GridId.Id(0, 0);

            populatedgrid       = new StarGrid(solid, 0, 0, Color.Transparent, 1.0F); // Duplicate grid id but asking for populated stars
            populatedgrid.dBAsk = SystemClassDB.SystemAskType.PopulatedStars;
            grids.Add(populatedgrid);                                                 // add last so shown last

            long total = SystemClassDB.GetTotalSystemsFast();

            total = Math.Min(total, 10000000);                  // scaling limit at 10mil
            long offset = (total - 1000000) / 100000;           // scale down slowly.. experimental!

            midpercentage -= (int)(offset / 2);
            farpercentage -= (int)(offset / 3);

            //midpercentage = 10;           // agressive debugging options
            //farpercentage = 1;

            Console.WriteLine("Grids " + grids.Count + " Database Stars " + total + " mid " + midpercentage + " far " + farpercentage);
        }