def test_koe(self): bits = Bits() map_dir = bits.gas_dir.get_subdir('world').get_subdir( 'maps').get_subdir('map_world') m = Map(map_dir, bits) self.assertIsInstance(m, Map) self.assertEqual(map_dir, m.gas_dir) self.assertEqual('"Kingdom of Ehb"', m.get_data().screen_name) self.assertEqual(81, len(m.get_regions()))
def handle_multi_world_levels(from_map: Map, to_map: Map, new_region: Region): if not to_map.is_multi_world(): if not from_map.is_multi_world(): pass # easy else: print( f'Note: Imported region is multi-world but target map is not. Removing world levels.' ) rem_region_world_levels(new_region) else: if not from_map.is_multi_world(): print( f'Warning: Target map is multi-world but imported region is not! Please add manually.' ) # add_region_world_levels is not really working else: if are_world_levels_compatible(from_map.get_data().worlds, to_map.get_data().worlds): pass # phew else: print( f'Warning: Both maps are multi-world, but their world levels differ! Good luck sorting that out.' )
def convert_map(m: Map): if not m.get_data().use_node_mesh_index: m.get_data().use_node_mesh_index = True m.save() print(f'Converted map {m.get_data().screen_name} to NMI')