/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2020-11-27 * Changed: 2023-05-15 * * */ #include "DailyNewsAgency.hpp" #include using ls::std::core::Class; using ls::std::event::Event; using std::string; using test::event::DailyNewsAgency; using test::event::NewsAgency; DailyNewsAgency::DailyNewsAgency() : NewsAgency("DailyNewsAgency") {} DailyNewsAgency::~DailyNewsAgency() noexcept = default; void DailyNewsAgency::listen(const Class &_info) { Event event = dynamic_cast(_info); if (event.getId() == "SeriousNewsEvent") { this->news = this->getName() + ": " + event.getParameterList().at("news"); } } void DailyNewsAgency::clear() { this->news.clear(); } string DailyNewsAgency::getNews() const { return this->news; }