Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Save current Events  (Read 2136 times)

0 Members and 1 Guest are viewing this topic.

dalhome3

  • Newbie
  • *
  • Posts: 3
    • View Profile
Save current Events
« on: August 03, 2016, 08:26:15 am »
Hey,  :)

I'm currently working on a project with a friend and we are both stumped on how we could remember what methods are currently being fired in events. I'm wondering if anyone knows a way to save all the current event methods into an array or delegate variables so that we can switch between two sets of event methods quickly.

The problem with just hard coding the methods is that we don't know what the other methods may be as we are working on an engine so the methods can be user specified.

Thanks

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Save current Events
« Reply #1 on: August 03, 2016, 03:17:06 pm »
Ideally you'd probably want something like a message bus, but if you just want some callbacks, you could use a std::function object.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything