Beispiel #1
0
            public bool CalculateWeight(TowerProgram[] programs)
            {
                if (ChildPrograms == null)
                {
                    ChildPrograms = programs.Where(x => ChildProgramNames.Contains(x.Name)).ToArray();
                }

                if (ChildPrograms.Any(x => x.WeightTotal == -1))
                {
                    return(false);
                }

                WeightTotal = ChildPrograms.Sum(x => x.WeightTotal) + Weight;
                return(true);
            }
Beispiel #2
0
 public bool IsUnbalanced()
 {
     return(ChildPrograms.Select(x => x.WeightTotal).Distinct().Count() > 1);
 }