home *** CD-ROM | disk | FTP | other *** search
- class LRG.LRGAction
- {
- var m_sName;
- var m_fLastUpdateTime;
- var m_fSPF;
- var m_fFPS;
- var m_fTotalActionTime;
- var m_sNextAction;
- var m_sActionType;
- function LRGAction(kActionParams)
- {
- }
- function init(kActionParams)
- {
- if(kActionParams.m_sName != undefined)
- {
- this.m_sName = kActionParams.m_sName;
- }
- this.m_fLastUpdateTime = 0;
- if(kActionParams.m_fSPF != undefined)
- {
- this.m_fSPF = kActionParams.m_fSPF;
- this.m_fFPS = 1 / this.m_fSPF;
- }
- else if(kActionParams.m_fFPS != undefined)
- {
- this.m_fFPS = kActionParams.m_fFPS;
- this.m_fSPF = 1 / this.m_fFPS;
- }
- if(kActionParams.m_fTotalActionTime != undefined)
- {
- this.m_fTotalActionTime = kActionParams.m_fTotalActionTime;
- }
- if(kActionParams.m_sNext != undefined)
- {
- this.m_sNextAction = kActionParams.m_sNext;
- }
- if(this.m_sActionType == undefined)
- {
- if(kActionParams.m_sType == undefined)
- {
- this.m_sActionType = "DEFAULT";
- }
- else
- {
- this.m_sActionType = kActionParams.m_sType;
- }
- }
- else if(kActionParams.m_sType != undefined)
- {
- this.m_sActionType = kActionParams.m_sType;
- }
- }
- function getName()
- {
- return this.m_sName;
- }
- function getType()
- {
- return this.m_sActionType;
- }
- function getNext()
- {
- return this.m_sNextAction;
- }
- function setNext(sNextAction)
- {
- this.m_sNextAction = sNextAction;
- }
- function reset(fCurrTime, kActionParams)
- {
- if(kActionParams)
- {
- this.init(kActionParams);
- }
- this.m_fLastUpdateTime = fCurrTime;
- }
- function update(fCurrTime, kClip)
- {
- if(this.m_fLastUpdateTime == 0)
- {
- this.m_fLastUpdateTime = fCurrTime;
- return false;
- }
- var _loc2_ = fCurrTime - this.m_fLastUpdateTime;
- if(_loc2_ >= this.m_fSPF)
- {
- this.m_fLastUpdateTime = fCurrTime;
- return this.doUpdate(fCurrTime,_loc2_,kClip);
- }
- return false;
- }
- function doUpdate(fCurrTime, fDeltaTimeSecs, kClip)
- {
- return true;
- }
- }
-