--
-- V1.0
-- @author 50keda
-- @date 13/10/2016
-- Copyright (C) 50keda, All Rights Reserved.




Utb445 = {};

function Utb445.prerequisitesPresent(specializations)

          AttacherJoints.registerJointType("WeightAttacher")

    return true;
end;

function Utb445:load(savegame)
    self.utb445_propelerAnim = getXMLString(self.xmlFile, "vehicle.propelerAnimation#animName");
    self.utb445_speedDivider = getXMLInt(self.xmlFile, "vehicle.propelerAnimation#speedDivider");

    if self.utb445_propelerAnim ~= nil and self.utb445_speedDivider ~= nil then
        self.utb445_initalized = true;
    else
        self.utb445_initalized = false;
    end
end;

function Utb445:delete()
end;

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

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

function Utb445:update(dt)
    
    if not self.utb445_initalized then
        return;
    end

    if self:getIsMotorStarted() then
        self:playAnimation(self.utb445_propelerAnim, 
                            self.motor.lastMotorRpm / self.utb445_speedDivider, 
                            self:getAnimationTime(self.utb445_propelerAnim), 
                            true);
    else
        self:stopAnimation(self.utb445_propelerAnim);
    end

end;

function Utb445:draw()
end;
