Beyond_Beyaan.Data_Managers.MasterTechnologyManager.GetRandomizedConstructionTechs C# (CSharp) Метод

GetRandomizedConstructionTechs() публичный Метод

public GetRandomizedConstructionTechs ( ) : List
Результат List
        public List<Technology> GetRandomizedConstructionTechs()
        {
            //Must include at least one tech from each tier
            List<Technology> randomList = new List<Technology>();
            for (int i = 0; i < 10; i++)
            {
                bool hasAtLeastOneTierTech = false;
                List<Technology> randomTierList = new List<Technology>();
                while (!hasAtLeastOneTierTech)
                {
                    randomTierList = new List<Technology>();
                    foreach (var tech in ConstructionTechs)
                    {
                        if (tech.TechLevel == 1 && i == 0)
                        {
                            //Include starting levels if on first tier
                            randomTierList.Add(tech);
                        }
                        else if (tech.TechLevel > (i * 5) && tech.TechLevel <= (i + 1) * 5 && _gameMain.Random.Next(100) < 50)
                        {
                            randomTierList.Add(tech);
                            hasAtLeastOneTierTech = true;
                        }
                    }
                }
                randomList.AddRange(randomTierList);
            }
            return randomList;
        }