31 lines
596 B
C++
31 lines
596 B
C++
#ifndef POLICY_H
|
|
#define POLICY_H
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
class Actor;
|
|
|
|
class Policy
|
|
{
|
|
public:
|
|
explicit Policy(const std::string& satisfaction, const std::string& dissatisfaction);
|
|
virtual ~Policy() = 0;
|
|
|
|
struct CheckResult
|
|
{
|
|
bool satisfied = false;
|
|
std::string commentary;
|
|
};
|
|
|
|
virtual CheckResult check(const std::shared_ptr<Actor> &actor) const = 0;
|
|
|
|
protected:
|
|
CheckResult composeMessageFromResult(bool result) const;
|
|
|
|
std::string _commentary_on_satisfaction;
|
|
std::string _commentary_on_dissatisfaction;
|
|
};
|
|
|
|
#endif // POLICY_H
|