import java.awt.*;
import java.awt.Image.*;

class FGAmpel {
// Attribute
	int d = 90;
        int x,y,lage;
	SLampe[] mLampe = new SLampe[2];
	int [] status = {0,0};
	Image kBild;

// Konstruktor
	public FGAmpel (int x, int y, int lage, Ampelanlage A){
		this.x=x;
		this.y=y;
		this.lage=lage;
		mLampe[0]=new SLampe(x+2,y+2,Color.red,"steh0.gif",A);
		mLampe[1]=new SLampe(x+2,y+4+d,Color.green,"geh0.gif",A);
	}

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

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