本文整理汇总了Python中horizons.util.startgameoptions.StartGameOptions.create_start_map方法的典型用法代码示例。如果您正苦于以下问题:Python StartGameOptions.create_start_map方法的具体用法?Python StartGameOptions.create_start_map怎么用?Python StartGameOptions.create_start_map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类horizons.util.startgameoptions.StartGameOptions
的用法示例。
在下文中一共展示了StartGameOptions.create_start_map方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: act
# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_start_map [as 别名]
def act(self, player_name, player_color):
map_file = self._get_selected_map()
options = StartGameOptions.create_start_map(map_file)
options.set_human_data(player_name, player_color)
options.ai_players = self._aidata.get_ai_players()
options.trader_enabled = self._game_settings.free_trader
options.pirate_enabled = self._game_settings.pirates
options.disasters_enabled = self._game_settings.disasters
options.natural_resource_multiplier = self._game_settings.natural_resource_multiplier
horizons.main.start_singleplayer(options)
示例2: act
# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_start_map [as 别名]
def act(self, player_name, player_color):
self.end()
self._mainmenu.show_loading_screen()
map_file = generate_random_map(*self._get_map_parameters())
options = StartGameOptions.create_start_map(map_file)
options.set_human_data(player_name, player_color)
options.ai_players = self._aidata.get_ai_players()
options.trader_enabled = self._game_settings.free_trader
options.pirate_enabled = self._game_settings.pirates
options.disasters_enabled = self._game_settings.disasters
options.natural_resource_multiplier = self._game_settings.natural_resource_multiplier
horizons.main.start_singleplayer(options)
示例3: start_single
# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_start_map [as 别名]
def start_single(self):
""" Starts a single player horizons. """
assert self.current is self.widgets['singleplayermenu']
playername = self.current.playerdata.get_player_name()
if not playername:
self.show_popup(_("Invalid player name"), _("You entered an invalid playername."))
return
playercolor = self.current.playerdata.get_player_color()
self._save_player_name()
if self.current.collectData('random'):
map_file = self._get_random_map_file()
else:
assert self.active_right_side.collectData('maplist') != -1
map_file = self._get_selected_map()
is_scenario = bool(self.current.collectData('scenario'))
if not is_scenario:
ai_players = int(self.current.aidata.get_ai_players())
horizons.globals.fife.set_uh_setting("AIPlayers", ai_players)
horizons.globals.fife.save_settings()
self.mainmenu.show_loading_screen()
if is_scenario:
try:
options = StartGameOptions.create_start_scenario(map_file)
options.set_human_data(playername, playercolor)
horizons.main.start_singleplayer(options)
except InvalidScenarioFileFormat as e:
self._show_invalid_scenario_file_popup(e)
self._select_single(show='scenario')
else: # free play/random map
options = StartGameOptions.create_start_map(map_file)
options.set_human_data(playername, playercolor)
options.ai_players = ai_players
options.trader_enabled = self.widgets['game_settings'].findChild(name='free_trader').marked
options.pirate_enabled = self.widgets['game_settings'].findChild(name='pirates').marked
options.disasters_enabled = self.widgets['game_settings'].findChild(name='disasters').marked
options.natural_resource_multiplier = self._get_natural_resource_multiplier()
horizons.main.start_singleplayer(options)
ExtScheduler().rem_all_classinst_calls(self)