Skip to content

Instantly share code, notes, and snippets.

@SamuXarick
Last active February 9, 2023 22:53
Show Gist options
  • Save SamuXarick/90ba38434f72fd9aacdc531582eb0cc7 to your computer and use it in GitHub Desktop.
Save SamuXarick/90ba38434f72fd9aacdc531582eb0cc7 to your computer and use it in GitHub Desktop.
how to make a template
/**
* Broadcast a new event to all active AIs, and to the Game Script.
*/
template <class ScriptEventType, typename ... Args>
static void BroadcastNewEvent(Args ... args, CompanyID skip_company = MAX_COMPANIES) {
AI::BroadcastNewEvent(new ScriptEventType(args...), skip_company);
Game::NewEvent(new ScriptEventType(args...));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment