

arbeitslichter = {};

function arbeitslichter.prerequisitesPresent(specializations)
    return SpecializationUtil.hasSpecialization(Steerable, specializations);
end;

function arbeitslichter:load(xmlFile)

    self.worklightfront = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.arbeitslichter.worklightfront#index"));
    self.worklightback = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.arbeitslichter.worklightback#index"));
    
    self.cablight = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.arbeitslichter.cablight#index"));


	self.worklightsFront = false;
	self.worklightsBack = false;

	self.worklightsCab = false;


end;

function arbeitslichter:keyEvent(unicode, sym, modifier, isDown)

end;

function arbeitslichter:update(dt)

    if self:getIsActiveForInput() and self.isEntered then


		if InputBinding.hasEvent(InputBinding.WORKLIGHTFRONT) then
		   	if self.worklightsFront == false then
		   	   self.worklightsFront = true
		   	else
		   		self.worklightsFront = false
		   	end;
		end;
		
		if InputBinding.hasEvent(InputBinding.WORKLIGHTBACK) then
		   	if self.worklightsBack == false then
		   	   self.worklightsBack = true
		   	else
		   		self.worklightsBack = false
		   	end;
		end;		

        if InputBinding.hasEvent(InputBinding.WORKLIGHTCAB) then
		   	if self.worklightsCab == false then
		   	   self.worklightsCab = true
		   	else
		   		self.worklightsCab = false
		   	end;
		end;
	end;	
		
if self.isEntered then

	-- WorklightBack
		if self.worklightsBack then
				setVisibility(self.worklightback, self.worklightsBack);
		else
				setVisibility(self.worklightback, self.worklightsBack, false);
		end;

	-- WorklightFront
		if self.worklightsFront then
				setVisibility(self.worklightfront, self.worklightsFront);
		else
				setVisibility(self.worklightfront, self.worklightsFront, false);
		end;
		
	-- Cablight
		if self.cablight then
				setVisibility(self.cablight, self.worklightsCab);
		else
				setVisibility(self.cablight, self.worklightsCab, false);
		end;


end;

end;

function arbeitslichter:draw()


end;

function arbeitslichter:onEnter()
end;

function arbeitslichter:onLeave()

       self.worklightsBack = false;
       self.worklightsFront = false;
       self.worklightsCab = false;
       setVisibility(self.worklightback, false);
       setVisibility(self.worklightfront, false);
       setVisibility(self.cablight, false);


end;

function arbeitslichter:delete()

       self.worklightsBack = false;
       self.worklightsFront = false;
       self.worklightsCab = false;
       setVisibility(self.worklightback, false);
       setVisibility(self.worklightfront, false);
       setVisibility(self.cablight, false);


end;

function arbeitslichter:mouseEvent(posX, posY, isDown, isUp, button)
end;





