slumber-quest/policies/readyitemrequiredpolicy.cpp

21 lines
578 B
C++
Raw Normal View History

2021-05-16 11:20:57 -04:00
#include "readyitemrequiredpolicy.h"
#include "actor.h"
ReadyItemRequiredPolicy::ReadyItemRequiredPolicy(const std::string& satisfaction, const std::string& dissatisfaction) :
Policy(satisfaction, dissatisfaction)
{}
ReadyItemRequiredPolicy::~ReadyItemRequiredPolicy()
{}
Policy::CheckResult ReadyItemRequiredPolicy::check(const std::shared_ptr<Actor>& actor) const
{
bool success = actor->isItemReady(_item);
return composeMessageFromResult(success);
}
void ReadyItemRequiredPolicy::setRequiredReadyItem(const std::shared_ptr<Item> &item)
{
_item = item;
}