LTBOOL FnLoadSenseRecordsList(HMESSAGEREAD hRead, void* pPtDataItem)
{
	CAISenseRecord* pAISenseRecord = FACTORY_NEW(CAISenseRecord);
	*((CAISenseRecord**)pPtDataItem) = pAISenseRecord;
	pAISenseRecord->Load(hRead);

    return LTTRUE;
}
Пример #2
0
void CAIHelicopterStrategyFollowPath::Constructor()
{
	CAIHelicopterStrategy::Constructor();

	m_eState = eStateUnset;
	m_AIMovement.Constructor();
	m_pPath = FACTORY_NEW(CAIPath);
}
Пример #3
0
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());
}
Пример #5
0
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;
}
Пример #6
0
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;
}
Пример #7
0
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;
	}
}
Пример #8
0
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);
		}
	}
}