public static CountryDescriptorData fromComponent(CountryDescriptor descriptor) { if (descriptor == null) { return null; } CountryDescriptorData descriptorData = new CountryDescriptorData(); descriptorData.id = descriptor.id; descriptorData.countryName = descriptor.countryName; return descriptorData; }
public static Country GetCountry(CountryDescriptorData countryDescriptor) { if (!countryDescriptor.isValid()) { return null; } if (!COUNTRIES.ContainsKey(countryDescriptor.countryName)) { GameLogger.printRed(string.Format("DynamicObjectRegistry:: country {0} not found", countryDescriptor.countryName)); return null; } return COUNTRIES[countryDescriptor.countryName]; }
public static void toComponent(CountryDescriptorData descriptorData, CountryDescriptor descriptor) { descriptor.id = descriptorData.id; descriptor.countryName = descriptorData.countryName; }