slumber-quest/policies/policy.h

31 lines
596 B
C
Raw Normal View History

2021-05-07 21:36:26 -04:00
#ifndef POLICY_H
#define POLICY_H
#include <memory>
2021-05-07 21:36:26 -04:00
#include <string>
class Actor;
2021-05-07 21:36:26 -04:00
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;
2021-05-07 21:36:26 -04:00
protected:
CheckResult composeMessageFromResult(bool result) const;
2021-05-07 21:36:26 -04:00
std::string _commentary_on_satisfaction;
std::string _commentary_on_dissatisfaction;
};
#endif // POLICY_H