Re: Storing an array of function calls, and their params..... -
16-05-2005
I'm coding for a game thats written in straight C, so virtual functions aren't available to me (easily anyway).
I'm creating a script system that is event based. The user can tell the game a bunch of different commands to execute when a certain event happens.
What I was looking to do, is parse the file, then save off the commands that are linked to each event happening in a stack like the one we're talking about.
Then, when the event happens, I can quickly execute the commands linked to that event, without reparsing anything, or working with strings.
It seemed the quickest way to do what I needed to do. If theres a better way, I'd be happy to hear about it, I'm always open to learning more, especially if its faster, or more efficient.
Dum Spiro Spero
|