Esempio n. 1
0
        public List<Wish> GetAllWishes()
        {
            var wishes = new WishList();
            wishes.AddOrFailIfExists(RuntimeWishes, 0);
            wishes.AddOrFailIfExists(ProvidedWishes, 0);
            wishes.AddOrFailIfExists(OptionalWishes, 0);
            wishes.AddOrFailIfExists(TransitiveWishes, 0);

            IncludeAllTransitivesOf(wishes, 0, wishes.ToList());

            return wishes.ToList();
        }
Esempio n. 2
0
 private void IncludeTransitivesOf(WishList addTo, int depth, Wish wish)
 {
     foreach (var child in wish.TransitiveWishes) {
         addTo.AddOrFailIfExists(child);
         IncludeTransitivesOf(addTo, depth + 1, child);
     }
 }