GossipNewsAgency.cpp 885 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: 2020-11-29
  7. *
  8. * */
  9. #include "GossipNewsAgency.hpp"
  10. ls_std_test::GossipNewsAgency::GossipNewsAgency() : ls_std_test::NewsAgency("GossipNewsAgency")
  11. {}
  12. void ls_std_test::GossipNewsAgency::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. if(event.getId() == "GossipNewsEvent") {
  19. this->news = this->getName() + ": " + event.getParameterList().at("news");
  20. }
  21. }
  22. void ls_std_test::GossipNewsAgency::clear()
  23. {
  24. this->news.clear();
  25. }
  26. std::string ls_std_test::GossipNewsAgency::getNews()
  27. {
  28. return this->news;
  29. }