DailyNewsAgency.cpp 751 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-27
  6. * Changed: 2020-11-29
  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. this->news = this->getName() + ": " + event.getParameterList().at("news");
  17. }
  18. }
  19. void ls_std_test::DailyNewsAgency::clear()
  20. {
  21. this->news.clear();
  22. }
  23. std::string ls_std_test::DailyNewsAgency::getNews()
  24. {
  25. return this->news;
  26. }