Skip to content

Commit

Permalink
Merge pull request #11 from Mw3y/step-6
Browse files Browse the repository at this point in the history
Step 6 fixes
  • Loading branch information
Mw3y authored Apr 8, 2024
2 parents e5e0440 + 06a90c0 commit 9c79e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch/epfl/chacun/GameState.java
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private Set<Animal> computeCancelledAnimals(Area<Zone.Meadow> meadowArea, int sp
Set<Animal> deer = getAnimalsOfKind(animals, Animal.Kind.DEER);
Set<Animal> tigers = getAnimalsOfKind(animals, Animal.Kind.TIGER);
// If the specified number of tigers is 0, take the number of tigers of the given meadow area
specifiedTigerNb = specifiedTigerNb >= 0 ? specifiedTigerNb : tigers.size();
specifiedTigerNb = specifiedTigerNb > 0 ? specifiedTigerNb : tigers.size();
// Compute the number of deer to cancel
int cancelledDeerNb = Math.min(specifiedTigerNb, deer.size());
Set<Animal> cancelledAnimals = new HashSet<>(cancelledDeerNb);
Expand Down

0 comments on commit 9c79e8a

Please sign in to comment.