- Shall I use a static class (all variables and methods are static) which tells each card what has been played/activated?
- Is <csignal> of any use for this?
- Shall I generate an instance of signal handler and send its reference to each Card (SignalHandler& sig_handler;)?
Members - Reputation: 414
Posted 09 April 2012 - 11:24 AM
Moderators - Reputation: 40180
Posted 09 April 2012 - 01:58 PM
Many games will implement their own event listeners; this model is supported by most modern languages where you can register event listeners, and easily broadcast to all interested listeners.
A simple search for "games message event bus" gives a bunch of useful descriptions of how to implement them, many including source code.
Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.
Also check out my personal website at bryanwagstaff.com, where I occasionally write about assorted stuff.