public void Awake()
 {
     nextDifficultyScalingPoint = difficultyScalingThreshold;
     if(difficultyLevel < startingDifficultyLevel)
     {
         int steps = startingDifficultyLevel - difficultyLevel;
         for (int i = 0; i<steps;++i)
         {
             ScaleDifficulty();
         }
     }
     bannedSection = builderWeights[0].type;
     bannedSectionWeight = builderWeights[0].weight;
     nextBannedSection = SectionBuilderType.bugs;
 }
    public void selectNewSectionBuilder()
    {
        if(levelData.activeSectionBuilder.type != SectionBuilderType.clear)
        {
            difficultyManager.BanSectionType(levelData.activeSectionBuilder.type);
            newBuilderType = SectionBuilderType.clear;
        }
        else
        {
            newBuilderType = difficultyManager.GetSectionBuilder();
        }

        levelData.activeSectionBuilder = availableSectionBuilders[newBuilderType];
        sectionBuilderConfigurator.configureSectionBuilder();
    }
 public BuilderWeight(SectionBuilderType type, float weight)
 {
     this.type = type;
     this.weight = weight;
 }
 public void BanSectionType(SectionBuilderType sectionTypeToBan)
 {
     nextBannedSection = sectionTypeToBan;
 }
 private void StoreBannedSectionInfo(BuilderWeight builderWeight)
 {
     bannedSection = builderWeight.type;
     bannedSectionWeight = builderWeight.weight;
 }
 private BuilderWeight GetBuilderWeightByType(SectionBuilderType type)
 {
     BuilderWeight builderWeight = null;
     for (int i = 0; i < builderWeights.Count; ++i)
     {
         if (builderWeights[i].type == type)
         {
             builderWeight = builderWeights[i];
         }
     }
     return builderWeight;
 }
 private void BanNextSection(SectionBuilderType sectionTypeToBan)
 {
     BuilderWeight newSectionToBan = GetBuilderWeightByType(sectionTypeToBan);
     StoreBannedSectionInfo(newSectionToBan);
     newSectionToBan.weight = 0f;
 }