Created
October 5, 2013 12:39
-
-
Save chopmann/6840455 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int removePlant(int x, int y) { | |
if (plantContainer[x][y] <= 0) { | |
plantContainer[x][y] = 0; | |
return 0; | |
} else { | |
plantContainer[x][y]--; | |
return plantEnergy; | |
} | |
} | |
plantEnergy ist ein variabler wert, aber er ist teil der Welt und nicht wirklich teil der Planzen. | |
Man kann es später ändern wenn man möchte, zB wenn man möchte das die Pflanzen mehr Energie liefern, | |
aber wie ich schon gesagt habe. Die Pflanzen sind bei dieser Aufgabe keine echte "Objekte". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment