本文整理汇总了C++中saved_game::get_replay_starting_pos方法的典型用法代码示例。如果您正苦于以下问题:C++ saved_game::get_replay_starting_pos方法的具体用法?C++ saved_game::get_replay_starting_pos怎么用?C++ saved_game::get_replay_starting_pos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类saved_game
的用法示例。
在下文中一共展示了saved_game::get_replay_starting_pos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: play_replay_level
LEVEL_RESULT play_replay_level(const config& game_config,
CVideo& video, saved_game& state_of_game, bool is_unit_test)
{
const int ticks = SDL_GetTicks();
DBG_NG << "creating objects... " << (SDL_GetTicks() - ticks) << std::endl;
boost::scoped_ptr<replay_controller> rc;
try {
rc.reset(new replay_controller(state_of_game.get_replay_starting_pos(), state_of_game, ticks, game_config, video));
} catch (end_level_exception & e){
return e.result;
} catch (end_turn_exception &) {
throw; //this should never happen? It would likely have crashed the program before, so in refactor I won't change but we should fix it later.
}
DBG_NG << "created objects... " << (SDL_GetTicks() - rc->get_ticks()) << std::endl;
const events::command_disabler disable_commands;
//replay event-loop
possible_end_play_signal signal = play_replay_level_main_loop(*rc, is_unit_test);
if (signal) {
switch( boost::apply_visitor( get_signal_type(), *signal ) ) {
case END_LEVEL:
DBG_NG << "play_replay_level: end_level_exception" << std::endl;
break;
case END_TURN:
DBG_NG << "Unchecked end_turn_exception signal propogated to replay controller play_replay_level! Terminating." << std::endl;
assert(false && "unchecked end turn exception in replay controller");
throw 42;
}
}
return VICTORY;
}