1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00
OpenMW/apps/openmw/mwworld/actionapply.cpp
2012-07-17 16:44:55 +02:00

29 lines
828 B
C++

#include "actionapply.hpp"
#include "class.hpp"
namespace MWWorld
{
ActionApply::ActionApply (const Ptr& target, const std::string& id, const Ptr& actor)
: mTarget (target), mId (id), mActor (actor)
{}
void ActionApply::execute()
{
MWWorld::Class::get (mTarget).apply (mTarget, mId, mActor);
}
ActionApplyWithSkill::ActionApplyWithSkill (const Ptr& target, const std::string& id,
const Ptr& actor, int skillIndex, int usageType)
: mTarget (target), mId (id), mActor (actor), mSkillIndex (skillIndex), mUsageType (usageType)
{}
void ActionApplyWithSkill::execute()
{
if (MWWorld::Class::get (mTarget).apply (mTarget, mId, mActor) && mUsageType!=-1)
MWWorld::Class::get (mTarget).skillUsageSucceeded (mActor, mSkillIndex, mUsageType);
}
}