class Dichte { //PROPERTIES float xa,ya,xb,yb; //eckpunkte des dichtefeldes float maxD;//maximale dichte float currD;//aktuelle dichte float a;//alphawert //--------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------- //CONSTRUCTOR Dichte(float xa,float ya,float xb,float yb,float maxD) { this.xa = xa; this.ya = ya; this.xb = xb; this.yb = yb; this.maxD = maxD; currD=0; a=0; } //--------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------- //METHODES boolean isFull() { return ( currD > maxD ); } //--------------------------------------------------------------------------------------------------------- void currDBigger() { currD += 1; a += 0.01; } //--------------------------------------------------------------------------------------------------------- void display() { fill(0,255,0,a); noStroke(); stroke(255); rectMode(CORNERS); rect(xa,ya,xb,yb); rectMode(CORNER); } //--------------------------------------------------------------------------------------------------------- //GETTER float getMaxD() { return this.maxD; } //--------------------------------------------------------------------------------------------------------- float getCurrD() { return this.currD; } //--------------------------------------------------------------------------------------------------------- float getXa() { return this.xa; } //--------------------------------------------------------------------------------------------------------- float getXb() { return this.xb; } //--------------------------------------------------------------------------------------------------------- float getYa() { return this.ya; } //--------------------------------------------------------------------------------------------------------- float getYb() { return this.yb; } //--------------------------------------------------------------------------------------------------------- }