---Made By @poc@lypse.

---For ls-modteam-France

renault = {};

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

function renault:load(xmlFile)



	       
    self.numjumWheels = Utils.getNoNil(getXMLInt(xmlFile, "vehicle.jumWheels#count"), 0);
    self.jumWheels = {};
    for i=1, self.numjumWheels do
        local jumWheelnamei = string.format("vehicle.jumWheels.jumWheel" .. "%d", i);
        self.jumWheels[i] = Utils.indexToObject(self.rootNode, getXMLInt(xmlFile, jumWheelnamei .. "#index"));
        setVisibility(self.jumWheels[i], false);
    end;
    self.numjumWheels2 = Utils.getNoNil(getXMLInt(xmlFile, "vehicle.jumWheels2#count"), 0);
    self.jumWheels2 = {};
    for i=1, self.numjumWheels2 do
        local jumWheelnamei = string.format("vehicle.jumWheels2.jumWheel" .. "%d", i);
        self.jumWheels2[i] = Utils.indexToObject(self.rootNode, getXMLInt(xmlFile, jumWheelnamei .. "#index"));
        setVisibility(self.jumWheels2[i], false);
    end;
    self.numjumWheels3 = Utils.getNoNil(getXMLInt(xmlFile, "vehicle.jumWheels3#count"), 0);
    self.jumWheels3 = {};
    for i=1, self.numjumWheels3 do
        local jumWheelnamei = string.format("vehicle.jumWheels3.jumWheel" .. "%d", i);
        self.jumWheels3[i] = Utils.indexToObject(self.rootNode, getXMLInt(xmlFile, jumWheelnamei .. "#index"));
        setVisibility(self.jumWheels3[i], false);
    end;


    self.jumWheelsActive = false;
    self.jumWheels2Active = false;
    self.jumWheels3Active = false;
     

end;

function renault:delete()
end;

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

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

    
    if isDown and sym == Input.KEY_6 then
		self.jumWheelsActive = not self.jumWheelsActive;      
	end;
	if isDown and sym == Input.KEY_5 then
		self.jumWheels2Active = not self.jumWheels2Active;
	end;
	if isDown and sym == Input.KEY_7 then
		self.jumWheels3Active = not self.jumWheels3Active;      
	end;
end;

 
function renault:update(dt)
  

   
  if self.isEntered then
       
        if not self.jumWheelsActive then
			for i=1, self.numjumWheels do
				local jumWheel = self.jumWheels[i];
				setVisibility(jumWheel, self.jumWheelsActive);
			end;
		else
			for i=1, self.numjumWheels do
				local jumWheel = self.jumWheels[i];
				setVisibility(jumWheel, self.jumWheelsActive, false);
			end;
		end;
    end;
        if not self.jumWheels2Active then
			for i=1, self.numjumWheels2 do
				local jumWheel = self.jumWheels2[i];
				setVisibility(jumWheel, self.jumWheels2Active);
			end;
		else
			for i=1, self.numjumWheels2 do
				local jumWheel = self.jumWheels2[i];
				setVisibility(jumWheel, self.jumWheels2Active, false);
			end;
		end;
		if not self.jumWheels3Active then
			for i=1, self.numjumWheels3 do
				local jumWheel = self.jumWheels3[i];
				setVisibility(jumWheel, self.jumWheels3Active);
			end;
		else
			for i=1, self.numjumWheels3 do
				local jumWheel = self.jumWheels3[i];
				setVisibility(jumWheel, self.jumWheels3Active, false);
			end;
		end;

end;

function renault:onLeave()
 
end;
 

function renault:draw()

end;