Skip to content

Commit

Permalink
fix(FishCollection): remove incorrect methods
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-schwarz committed Jun 12, 2024
1 parent 72265c0 commit 8ec74ca
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions src/main/java/fish_variety/FishCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,54 +84,4 @@ public int getPrice() {

return price;
}

public void addFishesUntilMaxPrice(int price) {
// boolean fishWasAdded = false;

// for (Fish fish : this.getUnaddedFishes()) {
// if (this.getPrice() + fish.getPrice() > price) {
// break;
// }

// this.add(fish);

// if (this.isValid()) {
// fishWasAdded = true;
// break;
// }

// this.remove(fish);
// }

// // Continue if fish was able to be added
// if (fishWasAdded) {
// this.addFishesUntilMaxPrice(price);
// }

ArrayList<Fish> unadded = this.getUnaddedFishes();

if (unadded.size() == 0) return;

// Add all unadded fish
Fish first = unadded.get(0);
this.add(first);

this.addFishesUntilMaxPrice(price);

if (!this.isValid()) {

}

// remove from the back
if (price < this.getPrice()) {
this.remove(first);
}
}

public void removeLeastConflicting() {
HashMap<Fish,ArrayList<Fish>> fishConflictMap = new HashMap<Fish,ArrayList<Fish>>();
for (Fish fish : this.fishes) {

}
}
}

0 comments on commit 8ec74ca

Please sign in to comment.