public static void UpdateConfiguration(this WorldStructure self, WorldConfiguration changedConfiguration) { for (int i = 0; i < self.WorldConfigurations.Count; i++) { if (self.WorldConfigurations[i].Id == changedConfiguration.Id) { self.WorldConfigurations[i] = changedConfiguration; } } }
public static void RemoveConfiguration(this WorldStructure self, WorldConfiguration deletedConfiguration) { WorldConfiguration result = null; foreach (WorldConfiguration worldConfiguration in self.WorldConfigurations) { if (worldConfiguration.Id == deletedConfiguration.Id) { result = worldConfiguration; } } if (result != null) { self.WorldConfigurations.Remove(result); } }