Advertisement
Guest User

test

a guest
Dec 10th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. for (Fish fishEntry : fish) {
  2. if (fishEntry.isAlive() && !fishIsSurroundedByRocks(fishEntry)) {
  3. fishEntry.move();
  4. for (Plant plant : plants) {
  5. if (plant.isAlive()) {
  6. if (plant.getRow() == fishEntry.getRow()
  7. && plant.getCol() == fishEntry.getCol()) {
  8. fishEatPlant(fishEntry, plant);
  9. // what if multiple plants here.... Might want
  10. // continue statement here
  11. }
  12. }
  13. }
  14. for (Fish otherFish : fish) {
  15. if (fishEntry != otherFish) {
  16. if (fishEntry.getCol() == otherFish.getCol()
  17. && fishEntry.getRow() == otherFish.getRow()) {
  18. fishEntry.fight(otherFish);
  19. }
  20. }
  21.  
  22. }
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement