--
-- Rolmako. Model:Dawider
-- Autor skryptu: Dawider(R)(PL)
-- Data: 1.06.2013
-- 

Rolmako = {};

function Rolmako.prerequisitesPresent(specializations)
	return true;
end;

function Rolmako:load(xmlFile)

	local ramie = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.ramie#index"));
	if ramie ~= nil then
		self.ramie = ramie;
	end;

	local silownik = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.silownik#index"));
	if silownik ~= nil then
		self.silownik = silownik;
	end;
	
	
end;

function Rolmako:delete()
end;

function Rolmako:keyEvent(unicode, sym, modifier, isDown)
end;
	
function Rolmako:update(dt)
	
	if self.ramie then
	 	if InputBinding.isPressed(InputBinding.gora) then
               self:setAnimationTime(1, self.animationParts[1].currentPosition+(self.animationParts[1].offSet+dt), false);
           elseif InputBinding.isPressed(InputBinding.dol) then
               self:setAnimationTime(1, self.animationParts[1].currentPosition-(self.animationParts[1].offSet+dt), false);
        end;
    end;
	
	if self.silownik then
	 	if InputBinding.isPressed(InputBinding.gora1) then
               self:setAnimationTime(2, self.animationParts[2].currentPosition+(self.animationParts[2].offSet+dt), false);
           elseif InputBinding.isPressed(InputBinding.dol1) then
               self:setAnimationTime(2, self.animationParts[2].currentPosition-(self.animationParts[2].offSet+dt), false);
        end;
    end;
	
end;	

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

function Rolmako:validateAttacherJoint(implement, jointDesc, dt) 
	return true; 
end; 

function Rolmako:draw()
end;