コード例 #1
0
 def get_industry_all_name_strings(self, industry):
     # names can vary in each economy
     result = []
     for economy in economy_schemas:
         name = industry.get_property("name", economy)
         result.append(utils.unwrap_nml_string_declaration(name))
     return set(result)
コード例 #2
0
ファイル: render_docs.py プロジェクト: Azusa257/XIS
 def get_industry_name(self, industry, economy=None):
     # industries don't store the name directly as a python attr, but in lang - so look it up in base_lang using string id
     name = industry.get_property('name', economy)
     string_id = utils.unwrap_nml_string_declaration(name)
     if string_id not in base_lang_strings:
         utils.echo_message('Warning: string ' + string_id + ' missing for docs')
     return base_lang_strings.get(string_id, 'NO NAME ' + str(name) + ' ' + industry.id)
コード例 #3
0
 def get_cargo_name(self, cargo):
     # cargos don't store the name directly as a python attr, but in lang - so look it up in base_lang using string id
     name = cargo.type_name
     string_id = utils.unwrap_nml_string_declaration(name)
     return base_lang_strings.get(string_id,
                                  "NO NAME " + str(name) + " " + cargo.id)
コード例 #4
0
 def get_nearby_station_name(self, industry):
     station_name = utils.unwrap_nml_string_declaration(
         industry.get_property("nearby_station_name", None))
     return base_lang_strings[station_name]