Example #1
0
/**
 * \brief Calls the on_paused() method of a Lua game.
 *
 * Does nothing if the method is not defined.
 *
 * \param game A game.
 */
void LuaContext::game_on_paused(Game& game) {

  if (!userdata_has_field(game.get_savegame(), "on_paused")) {
    return;
  }

  push_game(l, game.get_savegame());
  on_paused();
  lua_pop(l, 1);
}
Example #2
0
/**
 * @brief Calls the on_paused() method of a Lua game.
 * @param game A game.
 */
void LuaContext::game_on_paused(Game& game) {

  push_game(l, game.get_savegame());
  on_paused();
  lua_pop(l, 1);
}