Merge pull request #968 from Allofich/AIActivate

Use namespace block in aiactivate
pull/1/head
scrawl 9 years ago committed by GitHub
commit 17a54b2a97

@ -12,16 +12,20 @@
#include "steering.hpp"
#include "movement.hpp"
MWMechanics::AiActivate::AiActivate(const std::string &objectId)
: mObjectId(objectId)
{
}
MWMechanics::AiActivate *MWMechanics::AiActivate::clone() const
namespace MWMechanics
{
AiActivate::AiActivate(const std::string &objectId)
: mObjectId(objectId)
{
}
AiActivate *MWMechanics::AiActivate::clone() const
{
return new AiActivate(*this);
}
bool MWMechanics::AiActivate::execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration)
{
}
bool AiActivate::execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration)
{
ESM::Position pos = actor.getRefData().getPosition(); //position of the actor
const MWWorld::Ptr target = MWBase::Environment::get().getWorld()->searchPtr(mObjectId, false); //The target to follow
@ -49,15 +53,15 @@ bool MWMechanics::AiActivate::execute (const MWWorld::Ptr& actor, CharacterContr
}
return false;
}
}
int MWMechanics::AiActivate::getTypeId() const
{
int AiActivate::getTypeId() const
{
return TypeIdActivate;
}
}
void MWMechanics::AiActivate::writeState(ESM::AiSequence::AiSequence &sequence) const
{
void AiActivate::writeState(ESM::AiSequence::AiSequence &sequence) const
{
std::auto_ptr<ESM::AiSequence::AiActivate> activate(new ESM::AiSequence::AiActivate());
activate->mTargetId = mObjectId;
@ -65,10 +69,10 @@ void MWMechanics::AiActivate::writeState(ESM::AiSequence::AiSequence &sequence)
package.mType = ESM::AiSequence::Ai_Activate;
package.mPackage = activate.release();
sequence.mPackages.push_back(package);
}
}
MWMechanics::AiActivate::AiActivate(const ESM::AiSequence::AiActivate *activate)
AiActivate::AiActivate(const ESM::AiSequence::AiActivate *activate)
: mObjectId(activate->mTargetId)
{
{
}
}

Loading…
Cancel
Save