BulletMLLib.ChangeSpeedTask.SetupTask C# (CSharp) Method

SetupTask() protected method

this sets up the task to be run.
protected SetupTask ( Bullet bullet ) : void
bullet Bullet Bullet.
return void
        protected override void SetupTask(Bullet bullet)
        {
            //set the length of time to run this dude
              startDuration = Node.GetChildValue(ENodeName.term, this);

              //check for divide by 0
              if (0.0f == startDuration)
              {
            startDuration = 1.0f;
              }

              float ratio = TimeFix.Framerate / 60f;
              startDuration *= ratio;

              Duration = startDuration;

              switch (Node.GetChild(ENodeName.speed).NodeType)
              {
            case ENodeType.sequence:
              {
            SpeedChange = Node.GetChildValue(ENodeName.speed, this);
              }
              break;

            case ENodeType.relative:
              {
            SpeedChange = Node.GetChildValue(ENodeName.speed, this) / Duration;
              }
              break;

            default:
              {
            SpeedChange = (Node.GetChildValue(ENodeName.speed, this) - bullet.Speed) / Duration;
              }
              break;
              }
        }