class Field { int nestSmell; float foodSmell; boolean isObstacle; int foodAmount; int posX; int posY; Field(int x, int y, boolean obst, int food, int nSmell, float fSmell) { posX = x; posY = y; isObstacle = obst; foodAmount = food; nestSmell = nSmell; foodSmell = fSmell; } int getFoodAmount() { return foodAmount; } void setFoodAmount(int food) { foodAmount = food; } boolean isAnObstacle() { return isObstacle; } int getNestSmell() { return nestSmell; } int getX() { return posX; } int getY() { return posY; } void increaseFoodSmell(float increment) { foodSmell = foodSmell +increment; // foodSmell = increment; } void decreaseFoodSmell(float factor) { if (foodSmell > 0.1) { foodSmell = foodSmell *factor; //ausbreitung des geruchs /* for (int i=-1; i<=1; i++) { for (int k=-1; k<=1; k++) { if (i==0 && k==0) { }else if (getX()+i > 0 && getX()+i < theWorld.getWidth() && getY()+k > 0 && getY()+k < theWorld.getHeight()) { Field currField = (Field) theWorld.getField(getX()+i, getY()+k); currField.increaseFoodSmell(foodSmell*0.001); } } }*/ }else { foodSmell = 0; } } float getFoodSmell() { return foodSmell; } }