s3n10r – [2] – Event System

I’m thinking how to add plots to the game and how do I call the script when the trigger is triggered. And the only way that I have thought is use a vector to store all the scripts that need to be triggered when an event happen.
And the way that I used to notify events is event pool (I don’t know if the term is right, but it’s not poll). Basically it works like this. Every event will be pushed to the event pool, and event pool notify every listener that listening to this event.
I don’t know if there’s a better way to make a event system. Please leave a comment if you know it. Thanks 🙂



Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google+ photo

You are commenting using your Google+ account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )


Connecting to %s