Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void findParentBags (BagRule bag) {
- //List<BagRule> parentBagList = new ArrayList<BagRule>();
- if (BagRule.bagsThatCanHoldBag(bag.getColor(), bag.getAttribute(), bagRuleList).isEmpty()) {
- //System.out.println("FOUND");
- parentBagList.add(bag);
- }
- else {
- for (BagRule bagIterator : BagRule.bagsThatCanHoldBag(bag.getColor(), bag.getAttribute(), bagRuleList)) {
- //System.out.println("FOUND");
- parentBagList.add(bagIterator);
- findParentBags(bagIterator);
- }
- }
- //return parentBagList;
- }
Advertisement
Add Comment
Please, Sign In to add comment