LTBOOL FnLoadSenseRecordsList(HMESSAGEREAD hRead, void* pPtDataItem) { CAISenseRecord* pAISenseRecord = FACTORY_NEW(CAISenseRecord); *((CAISenseRecord**)pPtDataItem) = pAISenseRecord; pAISenseRecord->Load(hRead); return LTTRUE; }
void CAIHelicopterStrategyFollowPath::Constructor() { CAIHelicopterStrategy::Constructor(); m_eState = eStateUnset; m_AIMovement.Constructor(); m_pPath = FACTORY_NEW(CAIPath); }
void CAISharkStrategyFollowPath::Constructor() { super::Constructor(); m_eState = eStateUnset; m_AIMovement.Constructor(); m_pPath = FACTORY_NEW(CAIPath); m_eMovement = CAnimatorAIAnimal::eWalking; }
void CAISenseRecorder::Record(CAISense* pAISense) { CAISenseRecord* pRecord = FACTORY_NEW(CAISenseRecord); pRecord->FromSense(pAISense); pRecord->SetLifetime(g_pLTServer->GetTime() + GetLifetime(pAISense)); m_alstpSenseRecords[pAISense->GetType()].Add(pRecord); Link(pRecord->GetObject()); }
void CAIHelicopterStateGoto::Constructor() { CAIHelicopterState::Constructor(); m_pStrategyFollowPath = FACTORY_NEW(CAIHelicopterStrategyFollowPath); m_vDest = LTVector(0,0,0); m_cNodes = 0; m_iNextNode = 0; m_bLoop = LTFALSE; }
void CAIHelicopterStateAttack::Constructor() { CAIHelicopterState::Constructor(); for ( int iWeapon = 0 ; iWeapon < AI_MAX_WEAPONS ; iWeapon++ ) { m_abActiveWeapons[iWeapon] = LTTRUE; } m_pStrategyShoot = FACTORY_NEW(CAIHelicopterStrategyShoot); m_hTarget = LTNULL; }
void AI_Helicopter::SetState(CAIHelicopterState::AIHelicopterStateType eState) { // Delete the old state if ( m_pHelicopterState ) { FACTORY_DELETE(m_pHelicopterState); m_pHelicopterState = LTNULL; m_pVehicleState = LTNULL; m_pState = LTNULL; } switch ( eState ) { case CAIHelicopterState::eStateIdle: m_pHelicopterState = FACTORY_NEW(CAIHelicopterStateIdle); break; case CAIHelicopterState::eStateGoto: m_pHelicopterState = FACTORY_NEW(CAIHelicopterStateGoto); break; case CAIHelicopterState::eStateAttack: m_pHelicopterState = FACTORY_NEW(CAIHelicopterStateAttack); break; } m_pVehicleState = m_pHelicopterState; m_pState = m_pVehicleState; if ( !m_pHelicopterState ) { _ASSERT(LTFALSE); return; } // Init the state if ( !m_pHelicopterState->Init(this) ) { _ASSERT(LTFALSE); FACTORY_DELETE(m_pHelicopterState); m_pHelicopterState = LTNULL; } }
void Body::SetState(BodyState eBodyState, LTBOOL bLoad /* = LTFALSE */) { m_eBodyStatePrevious = m_eBodyState; m_eBodyState = eBodyState; if ( m_pState ) { FACTORY_DELETE(m_pState); m_pState = LTNULL; } switch ( m_eBodyState ) { case eBodyStateNormal: m_pState = FACTORY_NEW(CBodyStateNormal); break; case eBodyStateExplode: m_pState = FACTORY_NEW(CBodyStateExplode); break; case eBodyStateCrush: m_pState = FACTORY_NEW(CBodyStateCrush); break; case eBodyStateLaser: m_pState = FACTORY_NEW(CBodyStateLaser); break; case eBodyStateDecay: m_pState = FACTORY_NEW(CBodyStateDecay); break; case eBodyStateStairs: m_pState = FACTORY_NEW(CBodyStateStairs); break; case eBodyStateLedge: m_pState = FACTORY_NEW(CBodyStateLedge); break; case eBodyStateUnderwater: m_pState = FACTORY_NEW(CBodyStateUnderwater); break; case eBodyStateChair: m_pState = FACTORY_NEW(CBodyStateChair); break; case eBodyStatePoison: m_pState = FACTORY_NEW(CBodyStatePoison); break; case eBodyStateAcid: m_pState = FACTORY_NEW(CBodyStateAcid); break; case eBodyStateArrow: m_pState = FACTORY_NEW(CBodyStateArrow); break; case eBodyStateFade: m_pState = FACTORY_NEW(CBodyStateFade); break; case eBodyStateFly: case eBodyStateStuck: default: m_pState = LTNULL; break; } if ( m_pState ) { if ( !bLoad ) { m_pState->Init(this); } else { m_pState->InitLoad(this); } } }