本文整理汇总了C++中game_state::rng方法的典型用法代码示例。如果您正苦于以下问题:C++ game_state::rng方法的具体用法?C++ game_state::rng怎么用?C++ game_state::rng使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_state
的用法示例。
在下文中一共展示了game_state::rng方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: play_game
//.........这里部分代码省略.........
}
}
recorder.clear();
gamestate.replay_data.clear();
gamestate.start_scenario_ss.str("");
gamestate.clear_start_hero_data();
// On DEFEAT, QUIT, or OBSERVER_END, we're done now
if (res != VICTORY) {
if (res != OBSERVER_END || gamestate.classification().next_scenario.empty()) {
gamestate.snapshot = config();
return res;
}
const int dlg_res = gui2::show_message(disp.video(), _("Game Over"),
_("This scenario has ended. Do you want to continue the campaign?"),
gui2::tmessage::yes_no_buttons);
if (dlg_res == gui2::twindow::CANCEL) {
gamestate.snapshot = config();
return res;
}
}
// Continue without saving is like a victory,
// but the save game dialog isn't displayed
if (!end_level.prescenario_save) {
save_game_after_scenario = false;
}
// Switch to the next scenario.
gamestate.classification().scenario = gamestate.classification().next_scenario;
gamestate.rng().rotate_random();
// gamestate.rng().seed_random(rand(), 0);
scenario = NULL;
if (io_type == IO_NONE) {
scenario = &load_campagin_scenario(gamestate.classification().campaign, gamestate.classification().scenario, type);
if (scenario->empty()) {
scenario = NULL;
} else{
starting_pos = *scenario;
starting_pos["fog"] = fog;
starting_pos["shroud"] = shroud;
scenario = &starting_pos;
}
}
if (scenario != NULL) {
// to single-player campaign, there are multi-secenario,
// set this result to next start hero data
heros.reset_to_unstage();
heros_start = heros;
loadscreen::global_loadscreen_manager* loadscreen_manager = loadscreen::global_loadscreen_manager::get();
if (loadscreen_manager) {
loadscreen_manager->reset();
}
// Update the label
// std::string oldlabel = gamestate.classification().label;
t_string scenario_name = (*scenario)["name"];
if (gamestate.classification().abbrev.empty()) {
gamestate.classification().label = scenario_name;
gamestate.classification().original_label = scenario_name.base_str();
} else {