示例#1
0
 private void FillPlanetAllSectors(PlanetSectorType type)
 {
     if (planetSector != null)
     {
         for (int x = 0; x < planetSector.GetLength(0); x++)
         {
             for (int y = 0; y < planetSector.GetLength(1); y++)
             {
                 planetSector[x, y] |= type;
             }
         }
     }
 }
示例#2
0
        private void FillPlanetSectors(PlanetSectorType type, int percentage)
        {
            Random rand = new Random((int)(this.SystemId.Id >> 4 & 0xFFFFFF | (ulong)(this.SystemBodyId & 0xFF) << 8));

            if (planetSector != null)
            {
                for (int x = 0; x < planetSector.GetLength(0); x++)
                {
                    for (int y = 0; y < planetSector.GetLength(1); y++)
                    {
                        bool fill = (rand.Next(0, 100) <= percentage);
                        if (fill)
                        {
                            planetSector[x, y]  = (PlanetSectorType)((~1023) & (int)planetSector[x, y]);
                            planetSector[x, y] |= type;
                        }
                    }
                }
            }
        }