import java.awt.*;

class Ampel {
// Attribute
	int d = 90;
        int x,y,lage;
	Lampe[] mLampe = new Lampe[3];
	int [] status = {0,0,0};

// Konstruktor
	public Ampel (int x, int y, int lage){
		this.x=x;
		this.y=y;
		this.lage=lage;
		mLampe[0]=new Lampe(x+2,y+2,Color.red);
		mLampe[1]=new Lampe(x+2,y+4+d,Color.yellow);
		mLampe[2]=new Lampe(x+2,y+6+d+d,Color.green);
	}

	public void xpaint(Graphics g){
		g.setColor(Color.gray);
		g.fillRect(x,y,d+4,3*d+8);
		for (int i=0; i<3; i++){
			if (status[i]==1){
				mLampe[i].an(g); 
			}else{
				mLampe[i].aus(g);
			}
		}
	}
	
	public void set(int f1, int f2, int f3){
		status[0] = f1;
		status[1] = f2;
		status[2] = f3;
	}

	public int[] get(){
		return status;
	}
}
