Ejemplo n.º 1
0
 def load_config(self, config_object_header: ConfigHeader):
     super().load_config(config_object_header)
     teacher_path = config_object_header.get('teacher_path')
     self.teacher = ExternalClassWrapper(
         os.path.join(get_repo_directory(), teacher_path),
         BaseAgent).get_loaded_class()(self.name, self.team, self.index)
Ejemplo n.º 2
0
 def load_config(self, config_header: ConfigHeader):
     self.executable_path = config_header.getpath('java_executable_path')
     self.logger.info("Java executable is configured as {}".format(
         self.executable_path))
Ejemplo n.º 3
0
def create_loadout() -> ConfigHeader:
    header = ConfigHeader()
    header.add_value('team_color_id',
                     int,
                     default=0,
                     description='Primary Color selection')
    header.add_value('custom_color_id',
                     int,
                     default=0,
                     description='Secondary Color selection')
    header.add_value('car_id',
                     int,
                     default=0,
                     description='Car type (Octane, Merc, etc)')
    header.add_value('decal_id', int, default=0, description='Type of decal')
    header.add_value('wheels_id',
                     int,
                     default=0,
                     description='Wheel selection')
    header.add_value('boost_id', int, default=0, description='Boost selection')
    header.add_value('antenna_id',
                     int,
                     default=0,
                     description='Antenna Selection')
    header.add_value('hat_id', int, default=0, description='Hat Selection')
    header.add_value('paint_finish_id',
                     int,
                     default=0,
                     description='Paint Type (for first color)')
    header.add_value('custom_finish_id',
                     int,
                     default=0,
                     description='Paint Type (for secondary color)')
    header.add_value('engine_audio_id',
                     int,
                     default=0,
                     description='Engine Audio Selection')
    header.add_value('trails_id',
                     int,
                     default=0,
                     description='Car trail Selection')
    header.add_value('goal_explosion_id',
                     int,
                     default=0,
                     description='Goal Explosion Selection')
    header.add_value(
        'primary_color_lookup',
        str,
        default=None,
        description=
        'Finds the closest primary color swatch based on the provided RGB value '
        'like [34, 255, 60]')
    header.add_value(
        'secondary_color_lookup',
        str,
        default=None,
        description=
        'Finds the closest secondary color swatch based on the provided RGB value '
        'like [34, 255, 60]')

    return header
Ejemplo n.º 4
0
def create_loadout_paint() -> ConfigHeader:
    header = ConfigHeader()

    header.add_value('car_paint_id', int, default=0)
    header.add_value('decal_paint_id', int, default=0)
    header.add_value('wheels_paint_id', int, default=0)
    header.add_value('boost_paint_id', int, default=0)
    header.add_value('antenna_paint_id', int, default=0)
    header.add_value('hat_paint_id', int, default=0)
    header.add_value('trails_paint_id', int, default=0)
    header.add_value('goal_explosion_paint_id', int, default=0)

    return header
Ejemplo n.º 5
0
    def _create_loadout() -> ConfigHeader:
        header = ConfigHeader()
        header.add_value('team_color_id',
                         int,
                         default=27,
                         description='Primary Color selection')
        header.add_value('custom_color_id',
                         int,
                         default=75,
                         description='Secondary Color selection')
        header.add_value('car_id',
                         int,
                         default=23,
                         description='Car type (Octane, Merc, etc')
        header.add_value('decal_id',
                         int,
                         default=307,
                         description='Type of decal')
        header.add_value('wheels_id',
                         int,
                         default=1656,
                         description='Wheel selection')
        header.add_value('boost_id',
                         int,
                         default=0,
                         description='Boost selection')
        header.add_value('antenna_id',
                         int,
                         default=287,
                         description='Antenna Selection')
        header.add_value('hat_id', int, default=0, description='Hat Selection')
        header.add_value('paint_finish_id',
                         int,
                         default=1978,
                         description='Paint Type (for first color)')
        header.add_value('custom_finish_id',
                         int,
                         default=1978,
                         description='Paint Type (for secondary color)')
        header.add_value('engine_audio_id',
                         int,
                         default=0,
                         description='Engine Audio Selection')
        header.add_value('trails_id',
                         int,
                         default=0,
                         description='Car trail Selection')
        header.add_value('goal_explosion_id',
                         int,
                         default=1971,
                         description='Goal Explosion Selection')

        return header
Ejemplo n.º 6
0
 def load_config(self, config_header: ConfigHeader) -> None:
     self.path = config_header.get('path')
Ejemplo n.º 7
0
def add_player_to_config(index, player: Player, player_header: ConfigHeader):
    player_header.set_value(PARTICIPANT_CONFIG_KEY,
                            player.get_config_location(), index)
    player_header.set_value(PARTICIPANT_TEAM, player.get_team(), index)
    player_header.set_value(PARTICIPANT_LOADOUT_CONFIG_KEY,
                            player.get_loadout(), index)
Ejemplo n.º 8
0
 def load_config(self, config_header: ConfigHeader) -> None:
     self.path = config_header.getpath('path')
     if self.path == None:
         print("Error: No executable path set.")
Ejemplo n.º 9
0
 def load_config(self, config_header: ConfigHeader):
     self.dotnet_executable_path = config_header.getpath(
         'dotnet_executable_path')
     self.logger.info(".NET executable is configured as {}".format(
         self.dotnet_executable_path))
Ejemplo n.º 10
0
 def load_config(self, config_object_header: ConfigHeader):
     self.model_path = config_object_header.get('model_path')
Ejemplo n.º 11
0
 def load_config(self, config_object_header: ConfigHeader):
     self.model_path = config_object_header.get('model_path')
     self.load_model = config_object_header.getboolean('load_model')
Ejemplo n.º 12
0
 def load_config(self, config_header: ConfigHeader):
     # Grabs the executable in the config
     self.executable_path = config_header.getpath('executable_path')
     self.logger.info("Executable is configured as {}".format(self.executable_path))
Ejemplo n.º 13
0
 def load_config(self, config_header: ConfigHeader) -> None:
     self.ip = config_header["ip"].value
     self.port = config_header.getint("port")