package esercizio3;

public class Light {
	
	private boolean lightOn=false;
	private boolean bottomIn=false;
	private boolean bottomOut=false;
	
	Light(){}
	
	public boolean onOff(boolean light, boolean in, boolean out){
		
		this.lightOn=light;
		this.bottomIn=in;
		this.bottomOut=out;
		
		if((bottomIn || bottomOut) && !lightOn)
		{
			lightOn=true;
			return true; //luce accesa
		}
		else
		{ 
			lightOn=false;
			return false; //luce spenta
		}
	}
}
