#include "controller.h" #include "policy.h" #include "modificator.h" #include Controller::Controller(Initializer&& initializer) : _keywords(initializer.keywords), _interaction_message(initializer.message), _validator(nullptr) {} Controller::~Controller() {} bool Controller::validateInput(const std::string &input_word) const { return std::find(_keywords.begin(), _keywords.end(), input_word) != _keywords.end(); } void Controller::runModificators() const { for (const auto& modificator : _modificators) modificator->run(); } void Controller::setValidator(const std::shared_ptr& validator) { _validator = validator; } void Controller::setModificators(const std::list>& modificators) { _modificators = modificators; }