ag_anim = {};

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


function ag_anim:load(xmlFile)
self.charIdA1 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.anim1#index"));
self.clipIndexA1 = getXMLString(xmlFile, "vehicle.anim1#animationClip");

self.something = 0;

self.showhelp = false;
end;

function ag_anim:update(dt)
if self.isMotorStarted and self:getIsActiveForInput() and InputBinding.hasEvent(InputBinding.ANIMATION) then
self.something = self.something +1
end;

if self.something == 0 then
local charIdA1 = getAnimCharacterSet(self.charIdA1);
local clipIndexA1 = getAnimClipIndex(charIdA1, self.clipIndexA1);

assignAnimTrackClip(charIdA1, 0, clipIndexA1);
setAnimTrackLoopState(charIdA1, 0, false);
setAnimTrackSpeedScale(charIdA1, 0, 1);
enableAnimTrack(charIdA1, 0);

if getAnimTrackTime(charIdA1, 0) >= 1 then
setAnimTrackTime(charIdA1, 0, 0, 1);
end;

else
disableAnimTrack(charIdA1, 0);
end;

if self.something == 1 then
local charIdA1 = getAnimCharacterSet(self.charIdA1);
local clipIndexA1 = getAnimClipIndex(charIdA1, self.clipIndexA1);

assignAnimTrackClip(charIdA1, 0, clipIndexA1);
setAnimTrackLoopState(charIdA1, 0, false);
setAnimTrackSpeedScale(charIdA1, 0, 1);
enableAnimTrack(charIdA1, 0);

if getAnimTrackTime(charIdA1, 0) >= 20000 then
disableAnimTrack(charIdA1, 0, 0);
end;

else
disableAnimTrack(charIdA1, 0);
end;

if self.something == 2 then
local charIdA1 = getAnimCharacterSet(self.charIdA1);
local clipIndexA1 = getAnimClipIndex(charIdA1, self.clipIndexA1);

assignAnimTrackClip(charIdA1, 0, clipIndexA1);
setAnimTrackLoopState(charIdA1, 0, false);
setAnimTrackSpeedScale(charIdA1, 0, 1);
enableAnimTrack(charIdA1, 0);

if getAnimTrackTime(charIdA1, 0) <= getAnimClipDuration(charIdA1, clipIndexA1) then
enableAnimTrack(charIdA1, 0, 0);
end;

else
disableAnimTrack(charIdA1, 0);
end;

if self.something == 3 then self.something = 0;
end


end;

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

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

function ag_anim:draw()
end;

function ag_anim:delete()
end;

