Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (Fish fishEntry : fish) {
- if (fishEntry.isAlive() && !fishIsSurroundedByRocks(fishEntry)) {
- fishEntry.move();
- for (Plant plant : plants) {
- if (plant.isAlive()) {
- if (plant.getRow() == fishEntry.getRow()
- && plant.getCol() == fishEntry.getCol()) {
- fishEatPlant(fishEntry, plant);
- // what if multiple plants here.... Might want
- // continue statement here
- }
- }
- }
- for (Fish otherFish : fish) {
- if (fishEntry != otherFish) {
- if (fishEntry.getCol() == otherFish.getCol()
- && fishEntry.getRow() == otherFish.getRow()) {
- fishEntry.fight(otherFish);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement