def __init__( self, config: Config, simulation: TileStrategySimulation, ) -> None: self._logger = get_logger('TroopLoader', config) self._config = config self._simulation = simulation schema_file_path = self._config.get( 'global.troop_schema', 'opencombat/strategy/troops.xsd', ) self._xml_validator = XmlValidator( config, schema_file_path, )
def __init__( self, config: Config, units_file_path: str, ) -> None: self._config = config self._units = None # type: typing.List[UnitModel] self.schema_file_path = self._config.get( 'global.teams_schema', 'opencombat/strategy/units.xsd', ) self._xml_validator = XmlValidator( config, self.schema_file_path, ) self._root_element = self._xml_validator.validate_and_return( units_file_path, )