public void AddPossibleParent(Bag bag) { PossibleParentBags.Add(bag.BagLabel, bag); }
private void AddPossibleChild(Bag bag) { PossibleChildBags.Add(bag.BagLabel, new Tuple <Bag, int>(bag, childBags[bag.BagLabel])); }
private Dictionary <string, Tuple <Bag, int> > MergeDescendantBag(Dictionary <string, Tuple <Bag, int> > descendantBags, Bag bag, int count) { Dictionary <string, Tuple <Bag, int> > descendants = new Dictionary <string, Tuple <Bag, int> >(descendantBags); int newCount = count; descendants.TryGetValue(bag.BagLabel, out Tuple <Bag, int> existingDescendantBagType); if (existingDescendantBagType != null) { newCount += existingDescendantBagType.Item2; } descendants[bag.BagLabel] = new Tuple <Bag, int>(bag, newCount); return(descendants); }