original_docstring: 
          Verify all the information from a .si file
          :param name: The name of the ship
          :param info_file: The .si file that should conatin the ship info
          :return: tuple(list[str], dict|None) (errors, information)
          
docstring: Verify all the information from a .si file
docstring_tokens: Verify all the information from a . si file
code: def add_prototype(cls, name: str, info_file: str):
          """
          Verify all the information from a .si file
          :param name: The name of the ship
          :param info_file: The .si file that should conatin the ship info
          :return: tuple(list[str], dict|None) (errors, information)
          """
          errors = []
          if not os.path.isfile(info_file):
              raise RuntimeError(
                  f"Could not start game! {name} info file needed"
              )
  
          try:
              with open(info_file, 'r') as f:
                  info = yaml.safe_load(f)
          except Exception as e:
              raise RuntimeError(str(e))
  
          if not isinstance(info, dict):
              # We can't load anything else
              raise RuntimeError(f"Info for {name} must be a dictionary")
  
          emap(lambda x: _must_contain(info, errors, *x), [
              ('display_name', str),
              ('class', str),
              ('description', str),
              ('mobile', bool),
              ('hull', int),
              ('shield', int),
              ('fuel', int),
              ('base_power', (int, float)),
          ])
  
          if not info['class'] in cls.WEIGHT_CLASS:
              errors.append(f"Weigth class: '{info['class']}' not known!")
  
          # If there are hardpoints...
          if 'hardpoints' in info:
              if not isinstance(info['hardpoints'], list):
                  errors.append("Hardpoints must be a list of dictionaries")
              else:
                  for hp_info in info['hardpoints']:
                      hp_errors = []
                      Hardpoint.verify_ship_hardpoint(hp_info, hp_errors)
                      if hp_errors:
                          errors.append("Hardpoint failure:")
                          errors.extend(hp_errors)
  
          # If there are engines...
          if 'engines' in info:
              if not isinstance(info['engines'], list):
                  errors.append("Engines must be a list of dictionaries")
              else:
                  for engine_info in info['engines']:
                      engine_errors = []
                      Engine.verify_ship_engine(engine_info, engine_errors)
                      if engine_errors:
                          errors.append("Engine failure:")
                          errors.extend(engine_errors)
  
          # At a minimum there must be one sprite of "life/static.png"
          path = os.path.join(os.path.dirname(info_file), 'life/static.png')
          if not os.path.isfile(path):
              errors.append("life/static.png is required for all ships")
  
          if errors:
              print ("\n".join(errors))
              raise RuntimeError(
                  f"Could not start game! Loading error on: '{name}'"
              )
  
          info['data_directory'] = os.path.dirname(info_file)
          cls._ship_prototypes[info['display_name']] = info
code_tokens: def add_prototype ( cls , name : str , info_file : str ) : errors = [ ] if not os . path . isfile ( info_file ) : raise RuntimeError ( f"Could not start game! {name} info file needed" ) try : with open ( info_file , 'r' ) as f : info = yaml . safe_load ( f ) except Exception as e : raise RuntimeError ( str ( e ) ) if not isinstance ( info , dict ) : raise RuntimeError ( f"Info for {name} must be a dictionary" ) emap ( lambda x : _must_contain ( info , errors , * x ) , [ ( 'display_name' , str ) , ( 'class' , str ) , ( 'description' , str ) , ( 'mobile' , bool ) , ( 'hull' , int ) , ( 'shield' , int ) , ( 'fuel' , int ) , ( 'base_power' , ( int , float ) ) , ] ) if not info [ 'class' ] in cls . WEIGHT_CLASS : errors . append ( f"Weigth class: '{info['class']}' not known!" ) if 'hardpoints' in info : if not isinstance ( info [ 'hardpoints' ] , list ) : errors . append ( "Hardpoints must be a list of dictionaries" ) else : for hp_info in info [ 'hardpoints' ] : hp_errors = [ ] Hardpoint . verify_ship_hardpoint ( hp_info , hp_errors ) if hp_errors : errors . append ( "Hardpoint failure:" ) errors . extend ( hp_errors ) if 'engines' in info : if not isinstance ( info [ 'engines' ] , list ) : errors . append ( "Engines must be a list of dictionaries" ) else : for engine_info in info [ 'engines' ] : engine_errors = [ ] Engine . verify_ship_engine ( engine_info , engine_errors ) if engine_errors : errors . append ( "Engine failure:" ) errors . extend ( engine_errors ) path = os . path . join ( os . path . dirname ( info_file ) , 'life/static.png' ) if not os . path . isfile ( path ) : errors . append ( "life/static.png is required for all ships" ) if errors : print ( "\n" . join ( errors ) ) raise RuntimeError ( f"Could not start game! Loading error on: '{name}'" ) info [ 'data_directory' ] = os . path . dirname ( info_file ) cls . _ship_prototypes [ info [ 'display_name' ] ] = info
short_docstring: Verify all the information from a .si file
short_docstring_tokens: Verify all the information from a . si file
comment: """
          Verify all the information from a .si file
          :param name: The name of the ship
          :param info_file: The .si file that should conatin the ship info
          :return: tuple(list[str], dict|None) (errors, information)
          """$SEP$# We can't load anything else$SEP$# If there are hardpoints...$SEP$# If there are engines...$SEP$# At a minimum there must be one sprite of "life/static.png"