home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / flameout.swf / scripts / __Packages / LRG / LRGAction.as next >
Encoding:
Text File  |  2006-06-13  |  2.3 KB  |  98 lines

  1. class LRG.LRGAction
  2. {
  3.    var m_sName;
  4.    var m_fLastUpdateTime;
  5.    var m_fSPF;
  6.    var m_fFPS;
  7.    var m_fTotalActionTime;
  8.    var m_sNextAction;
  9.    var m_sActionType;
  10.    function LRGAction(kActionParams)
  11.    {
  12.    }
  13.    function init(kActionParams)
  14.    {
  15.       if(kActionParams.m_sName != undefined)
  16.       {
  17.          this.m_sName = kActionParams.m_sName;
  18.       }
  19.       this.m_fLastUpdateTime = 0;
  20.       if(kActionParams.m_fSPF != undefined)
  21.       {
  22.          this.m_fSPF = kActionParams.m_fSPF;
  23.          this.m_fFPS = 1 / this.m_fSPF;
  24.       }
  25.       else if(kActionParams.m_fFPS != undefined)
  26.       {
  27.          this.m_fFPS = kActionParams.m_fFPS;
  28.          this.m_fSPF = 1 / this.m_fFPS;
  29.       }
  30.       if(kActionParams.m_fTotalActionTime != undefined)
  31.       {
  32.          this.m_fTotalActionTime = kActionParams.m_fTotalActionTime;
  33.       }
  34.       if(kActionParams.m_sNext != undefined)
  35.       {
  36.          this.m_sNextAction = kActionParams.m_sNext;
  37.       }
  38.       if(this.m_sActionType == undefined)
  39.       {
  40.          if(kActionParams.m_sType == undefined)
  41.          {
  42.             this.m_sActionType = "DEFAULT";
  43.          }
  44.          else
  45.          {
  46.             this.m_sActionType = kActionParams.m_sType;
  47.          }
  48.       }
  49.       else if(kActionParams.m_sType != undefined)
  50.       {
  51.          this.m_sActionType = kActionParams.m_sType;
  52.       }
  53.    }
  54.    function getName()
  55.    {
  56.       return this.m_sName;
  57.    }
  58.    function getType()
  59.    {
  60.       return this.m_sActionType;
  61.    }
  62.    function getNext()
  63.    {
  64.       return this.m_sNextAction;
  65.    }
  66.    function setNext(sNextAction)
  67.    {
  68.       this.m_sNextAction = sNextAction;
  69.    }
  70.    function reset(fCurrTime, kActionParams)
  71.    {
  72.       if(kActionParams)
  73.       {
  74.          this.init(kActionParams);
  75.       }
  76.       this.m_fLastUpdateTime = fCurrTime;
  77.    }
  78.    function update(fCurrTime, kClip)
  79.    {
  80.       if(this.m_fLastUpdateTime == 0)
  81.       {
  82.          this.m_fLastUpdateTime = fCurrTime;
  83.          return false;
  84.       }
  85.       var _loc2_ = fCurrTime - this.m_fLastUpdateTime;
  86.       if(_loc2_ >= this.m_fSPF)
  87.       {
  88.          this.m_fLastUpdateTime = fCurrTime;
  89.          return this.doUpdate(fCurrTime,_loc2_,kClip);
  90.       }
  91.       return false;
  92.    }
  93.    function doUpdate(fCurrTime, fDeltaTimeSecs, kClip)
  94.    {
  95.       return true;
  96.    }
  97. }
  98.