DailyNewsAgency.cpp 755 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-27
  6. * Changed: 2021-04-23
  7. *
  8. * */
  9. #include "DailyNewsAgency.hpp"
  10. ls_std_test::DailyNewsAgency::DailyNewsAgency() : ls_std_test::NewsAgency("DailyNewsAgency")
  11. {}
  12. void ls_std_test::DailyNewsAgency::listen(const ls_std::Class &_info)
  13. {
  14. ls_std::Event event = dynamic_cast<const ls_std::Event &>(_info);
  15. if (event.getId() == "SeriousNewsEvent")
  16. {
  17. this->news = this->getName() + ": " + event.getParameterList().at("news");
  18. }
  19. }
  20. void ls_std_test::DailyNewsAgency::clear()
  21. {
  22. this->news.clear();
  23. }
  24. std::string ls_std_test::DailyNewsAgency::getNews()
  25. {
  26. return this->news;
  27. }