public static void AddProvince(ProvinceDescriptor provinceDescriptor, Province province) { if (!provinceDescriptor.isValid()) { GameLogger.printRed(string.Format("DynamicObjectRegistry:: Cannot add invalid {0} province descriptor!", provinceDescriptor.provinceName)); return; } if (PROVINCES.ContainsKey(provinceDescriptor.provinceName)) { GameLogger.printRed(string.Format("DynamicObjectRegistry:: Province {0} already present!", provinceDescriptor.provinceName)); return; } PROVINCES.Add(provinceDescriptor.provinceName, province); }
public static Province GetProvince(ProvinceDescriptor provinceDescriptor) { if (!provinceDescriptor.isValid()) { return null; } if (!PROVINCES.ContainsKey(provinceDescriptor.provinceName)) { GameLogger.printRed(string.Format("DynamicObjectRegistry:: province {0} not found", provinceDescriptor.provinceName)); return null; } return PROVINCES[provinceDescriptor.provinceName]; }