// Bascule, herite de Composant
public class Bascule extends Composant {

	static int n = 1;
	
	public Bascule(int n_out){
		super(2, n_out);
		charName 	  = "C4";
		composantName = "Bascule";
		Name		  = "Bascule_"+(n++);
		pin_in.get(0).name = "On";
		pin_in.get(1).name = "Off";
	}
	
	boolean state = false;
	protected void doWork(Pin pn) {
		state = (pn == pin_in.get(0) && pn.isOn());
		for(Pin pin : pin_out)
			pin.setState(state);
	}

}
