예제 #1
0
 private void UpdateSpecialResources() {
     XYield totalSpecial = new XYield();
     var specialResources = Composition.GetPlanetData().Select(pd => pd.SpecialResources);
     if (!specialResources.IsNullOrEmpty()) {
         var totalSpecialFromPlanets = specialResources.Aggregate<XYield>(
             (accumulator, x) => new XYield() {   // Aggregate throws up if source enumerable is empty
                 Special_1 = accumulator.Special_1 + x.Special_1,
                 Special_2 = accumulator.Special_2 + x.Special_2,
                 Special_3 = accumulator.Special_3 + x.Special_3
             });
         totalSpecial.Add(totalSpecialFromPlanets);
     }
     totalSpecial.Add(Composition.StarData.SpecialResources);
     SpecialResources = totalSpecial;
 }
예제 #2
0
파일: XYield.cs 프로젝트: Maxii/UnityEntry
 public void Add(XYield other) {
     Special_1 += other.Special_1;
     Special_2 += other.Special_2;
     Special_3 += other.Special_3;
 }