Merge pull request #968 from Allofich/AIActivate

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

@ -12,15 +12,19 @@
#include "steering.hpp"
#include "movement.hpp"
MWMechanics::AiActivate::AiActivate(const std::string &objectId)
namespace MWMechanics
{
AiActivate::AiActivate(const std::string &objectId)
: mObjectId(objectId)
{
}
MWMechanics::AiActivate *MWMechanics::AiActivate::clone() const
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
@ -51,12 +55,12 @@ 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;
@ -67,8 +71,8 @@ void MWMechanics::AiActivate::writeState(ESM::AiSequence::AiSequence &sequence)
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