* Scripting language independent callback mechanism. * * This allows Micropolis to send callback messages with * a variable number of typed parameters back to the * scripting language, while maintining independence from * the particular scripting language (or user interface * runtime). * * The name is the name of a message to send. * The params is a string that specifies the number and *
| 273 | * @param params Parameters of the callback. |
| 274 | */ |
| 275 | void Micropolis::callback(const char *name, const char *params, ...) |
| 276 | { |
| 277 | if (callbackHook == NULL) { |
| 278 | return; |
| 279 | } |
| 280 | |
| 281 | va_list arglist; |
| 282 | va_start(arglist, params); // beginning after last named argument: params |
| 283 | |
| 284 | (*callbackHook)(this, callbackData, name, params, arglist); |
| 285 | |
| 286 | va_end(arglist); |
| 287 | } |
| 288 | |
| 289 | |
| 290 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected