Example #1
0
        public static void Initialize(int[] minCount, int[] maxCount, int[] size, int[] count, int koefMin, int koefMax, string[] types, int typesCount, double[] outMapRad, Field space, int mapLen)
        {
            Size = size;
            Count = count;
            OutMapRad = outMapRad;
            Types = types;
            MinCount = minCount;
            MaxCount = maxCount;
            KoefMax = koefMax;
            KoefMin = koefMin;
            TypesCount = typesCount;
            Space = space;
            MapLen = mapLen;

            Random rand = new Random();
            int sCount;
            AllStars = new List<Star>[TypesCount];
            for (int j = 0; j < AllStars.Length; j++)
            {
                sCount = rand.Next(MinCount[j], MaxCount[j]);
                AllStars[j] = new List<Star>();
                for (int i = 0; i < sCount; i++)
                {
                    AllStars[j].Add(new Star(rand.Next(Count[j]), OutMapRad[j], 0 - OutMapRad[j], 0 - OutMapRad[j], MapLen + OutMapRad[j], MapLen + OutMapRad[j]));
                }
            }
        }
Example #2
0
 public static void Initialize(Field downBorder, Field minimapBorder, int frame)
 {
     SkipCurrentStructureInfo();
     IsShow = false;
     RectStats = new Rectangle(downBorder.X + Rad, downBorder.Y + Rad + frame, RectStatsWidth, RectStatsHeight);
     RectIcon = new Rectangle(RectStats.X + RectStats.Width + Rad + FirstInfoWidth / 2 - ConstrPanelControl.SlotSize / 2, downBorder.Y + Rad + frame, ConstrPanelControl.SlotSize, ConstrPanelControl.SlotSize);
     RectFirstInfo = new Rectangle(RectStats.X + RectStats.Width + Rad, RectIcon.Y + RectIcon.Height + Rad, FirstInfoWidth, FirstInfoHeight);
     RectSecondInfo = new Rectangle(RectFirstInfo.X + RectFirstInfo.Width + Rad, downBorder.Y + Rad + frame, SecondInfoWidth, downBorder.Height - 2 * Rad - frame);
     RectButton = new Rectangle(RectFirstInfo.X + FirstInfoWidth / 2 - ButtonWidth / 2, RectFirstInfo.Y + RectFirstInfo.Height + Rad, ButtonWidth, ButtonHeight);
     RectCurrentPrice = new Rectangle(minimapBorder.X + Rad + frame, minimapBorder.Y - Rad - RectCurrentPriceHeight, minimapBorder.Width - 2 * Rad - frame, RectCurrentPriceHeight);
     LabStats = new Label("", RectStats, true, true, SupportedStructures.OurFonts.infoFont);
     LabFirstInfo = new Label("", RectFirstInfo, true, true, SupportedStructures.OurFonts.infoFont);
     LabSecondInfo = new Label("", RectSecondInfo, true, true, SupportedStructures.OurFonts.infoFont);
     LabCurrentPrice = new Label("", RectCurrentPrice, true, true, SupportedStructures.OurFonts.infoFont);
 }