Exemplo n.º 1
0
 /// <summary>
 /// Analyze ComboArmyBuild object after building army
 /// </summary>
 public void PostBuildAnalyze(ComboArmyBuilder builder)
 {
     //analyze changes
     //size
     if (size_ != builder.RealSize)
     {
         ++size_changed_;
     }
     //power
     if ((power_ - builder.RealPower) > builder.WeakestMonster.Power * 100)
     {
         ++power_changed_;
     }
     //alignment
     if (alignment_ != builder.CurrentAlignment)
     {
         ++alignment_changed_;
     }
     //composition
     for (int i = 0; i < traits_.Length; ++i)
     {
         if (traits_[i] != builder.PlaceHolders[i].Traits)
         {
             ++composition_changed_;
             break;
         }
     }
     ++count_[builder.Size - 1];      //count of armies
     ++count2_[builder.RealSize - 1]; //count of armies
 }
Exemplo n.º 2
0
        /// <summary>
        /// Analyze ComboArmyBuild object before building army
        /// </summary>
        public void PreBuildAnalyze(ComboArmyBuilder builder)
        {
            //save initial data
            size_      = builder.Size;
            power_     = builder.Power;
            alignment_ = builder.Alignment;
            traits_    = new MonsterTraits[builder.PlaceHolders.Count];
            int i = 0;

            builder.PlaceHolders.ForEach(
                delegate(MonsterPlaceHolder h) {
                traits_[i++] = h.Traits;
            }
                );
        }