DailyNewsAgency.cpp 778 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: 2022-05-09
  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::core::Class &_info)
  13. {
  14. ls::std::event::Event event = dynamic_cast<const ls::std::event::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. }