DailyNewsAgency.cpp 876 B

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