21 lines
578 B
C++
21 lines
578 B
C++
|
#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;
|
||
|
}
|