Commit a5f31b84 authored by Stefan Michel's avatar Stefan Michel

bugfix beim resizen durch aenderung bei Methoden signatur entstanden

parent e179b2f8
......@@ -23,8 +23,8 @@ public class Terrain extends Observable {
private Hamster hamster;
private String name = "DefaultHamster";
int maxRows = 10;
int maxCols = 10;
int maxCols = 20;
int maxRows = 15;
int hamsterRow = 0;
int hamsterCol = 0;
......@@ -100,7 +100,7 @@ public class Terrain extends Observable {
public void putDown() {
if (this.hamsterCorns > 0) {
this.hamsterCorns--;
this.map[this.hamsterRow][this.hamsterCol]++;
this.map[this.hamsterCol][this.hamsterRow]++;
} else throw new NoCornException();
setChanged();
notifyObservers();
......@@ -182,7 +182,7 @@ public class Terrain extends Observable {
public void pickUp() {
if (this.foundCorn() > 0) {
this.hamsterCorns++;
this.map[this.hamsterRow][this.hamsterCol]--;
this.map[this.hamsterCol][this.hamsterRow]--;
} else throw new NoCornException();
setChanged();
notifyObservers();
......
......@@ -48,8 +48,8 @@ public class TerritoriumPanelFX extends Region implements Observer {
private void drawField() {
//Feld zeichnen
for (int j = 0; j < terrain.getMaxCols(); j++) {
for (int i = 0; i < terrain.getMaxRows(); i++) {
for (int i = 0; i < terrain.getMaxCols(); i++) {
for (int j = 0; j < terrain.getMaxRows(); j++) {
Tile tile = new Tile(i, j);
// koerner setzen
......
......@@ -9,7 +9,6 @@ import static view.TerritoriumPanelFX.TILE_SIZE;
public class Tile extends StackPane {
private int x, y;
public Tile(int x, int y) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment