--
-- Autor: Hewaaa
-- Date: 14.01.2013
-- publisher: www.ls2013.org
--

GAZ_69 = {};

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

function GAZ_69:load(xmlFile)
		--Erster Trigger
	self.Trigger1 = GAZ_69.Trigger1;
	self.TriggerIndex1 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.GAZ_69_Trigger1#index"));
	addTrigger(self.TriggerIndex1, "Trigger1", self);
	self.enteredTrigger1 = false;
		--Zweiter Trigger
	self.Trigger2 = GAZ_69.Trigger2;
	self.TriggerIndex2 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.GAZ_69_Trigger2#index"));
	addTrigger(self.TriggerIndex2, "Trigger2", self);
	self.enteredTrigger2 = false;
	
end;

function GAZ_69:Trigger1(triggerId, otherId, onEnter, onLeave, onStay, otherShapeId)
	if onEnter then
		self.enteredTrigger1 = true;
	end;
	if onLeave then 
		self.enteredTrigger1 = false;
	end;
end;

function GAZ_69:Trigger2(triggerId, otherId, onEnter, onLeave, onStay, otherShapeId)
	if onEnter then
		self.enteredTrigger2 = true;
	end;
	if onLeave then 
		self.enteredTrigger2 = false;
	end;
end;


function GAZ_69:readStream(streamId, connection)
	
end;

function GAZ_69:writeStream(streamId, connection)	
	
end;

function GAZ_69:delete()
	
end;

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

function GAZ_69:keyEvent(unicode, sym, modifier, isDown)
end;

function GAZ_69:update(dt)
	
	if self:getIsActiveForInput() then
		if InputBinding.isPressed(InputBinding.GAZ_69_1) then
			self:setAnimationTime(1, self.animationParts[1].currentPosition+(self.animationParts[1].offSet*(dt/10)));
		end;
		if InputBinding.isPressed(InputBinding.GAZ_69_2) then
			self:setAnimationTime(1, self.animationParts[1].currentPosition-(self.animationParts[1].offSet*(dt/10)));
		end;
				if self.animationParts[1].clipEndTime then
					g_currentMission:addHelpButtonText(string.format(g_i18n:getText("GAZ_69_2")), InputBinding.GAZ_69_2);
				else
					g_currentMission:addHelpButtonText(string.format(g_i18n:getText("GAZ_69_1")), InputBinding.GAZ_69_1);
				end;
		if InputBinding.isPressed(InputBinding.GAZ_69_3) then
			self:setAnimationTime(2, self.animationParts[2].currentPosition+(self.animationParts[2].offSet*(dt/10)));
		end;
		if InputBinding.isPressed(InputBinding.GAZ_69_4) then
			self:setAnimationTime(2, self.animationParts[2].currentPosition-(self.animationParts[2].offSet*(dt/10)));
		end;
				if self.animationParts[2].clipEndTime then
					g_currentMission:addHelpButtonText(string.format(g_i18n:getText("GAZ_69_4")), InputBinding.GAZ_69_4);
				else
					g_currentMission:addHelpButtonText(string.format(g_i18n:getText("GAZ_69_3")), InputBinding.GAZ_69_3);
				end;
	end;

end;

function GAZ_69:updateTick(dt)
end;

function GAZ_69:draw()
end;

function GAZ_69:onLeave()
	
end;