from empires import compile_home_system_list, setup_empire from fields import generate_fields from natives import generate_natives from monsters import generate_monsters from specials import distribute_specials from util import int_hash, seed_rng, report_error, error_list from universe_tables import MAX_JUMPS_BETWEEN_SYSTEMS, MAX_STARLANE_LENGTH import universe_statistics from common import six from common.handlers import init_handlers from common.listeners import listener from common.option_tools import parse_config parse_config(fo.get_options_db_option_str("ai-config"), fo.get_user_config_dir()) init_handlers(fo.get_options_db_option_str("ai-config"), None) class PyGalaxySetupData: """ Class used to store and manage a copy of the galaxy setup data provided by the FreeOrion interface. This data can then be modified when needed during the universe generation process, without having to change the original data structure. """ def __init__(self, galaxy_setup_data): self.seed = galaxy_setup_data.seed self.size = galaxy_setup_data.size self.shape = galaxy_setup_data.shape self.age = galaxy_setup_data.age self.starlane_frequency = galaxy_setup_data.starlaneFrequency self.planet_density = galaxy_setup_data.planetDensity
try: main_timer.start(action.__name__) action() main_timer.stop() except Exception as e: error("Exception %s while trying to %s" % (e, action.__name__), exc_info=True) main_timer.stop_print_and_clear() turn_timer.stop_print_and_clear() debug('Size of issued orders: ' + str(fo.getOrders().size)) turn_timer.start("Server_Processing") try: fo.doneTurn() except Exception as e: error("Exception %s while trying doneTurn()" % e, exc_info=True) # TODO move it to cycle above finally: aistate.last_turn_played = fo.currentTurn() if using_statprof: try: statprof.stop() statprof.display() statprof.start() except: pass init_handlers(fo.getOptionsDBOptionStr("ai-config"), fo.getAIDir())
from galaxy import calc_star_system_positions from starsystems import name_planets, generate_systems from empires import compile_home_system_list, setup_empire from fields import generate_fields from natives import generate_natives from monsters import generate_monsters from specials import distribute_specials from util import int_hash, seed_rng, report_error, error_list from universe_tables import MAX_JUMPS_BETWEEN_SYSTEMS, MAX_STARLANE_LENGTH import universe_statistics from common.handlers import init_handlers from common.listeners import listener from common.option_tools import parse_config parse_config(fo.get_options_db_option_str("ai-config"), fo.get_user_config_dir()) init_handlers(fo.get_options_db_option_str("ai-config"), None) class PyGalaxySetupData: """ Class used to store and manage a copy of the galaxy setup data provided by the FreeOrion interface. This data can then be modified when needed during the universe generation process, without having to change the original data structure. """ def __init__(self, galaxy_setup_data): self.seed = galaxy_setup_data.seed self.size = galaxy_setup_data.size self.shape = galaxy_setup_data.shape self.age = galaxy_setup_data.age self.starlane_frequency = galaxy_setup_data.starlaneFrequency self.planet_density = galaxy_setup_data.planetDensity