public void Dispose() { foreach (var r in AbilityRules.ToArray()) { r.Dispose(); } foreach (var sos in StellarObjectSizes.ToArray()) { sos.Dispose(); } foreach (var x in StellarAbilityTemplates.ToArray()) { x.Dispose(); } foreach (var sot in StellarObjectTemplates.ToArray()) { sot.Dispose(); } foreach (var t in Traits.ToArray()) { t.Dispose(); } foreach (var t in Technologies.ToArray()) { t.Dispose(); } foreach (var f in FacilityTemplates.ToArray()) { f.Dispose(); } foreach (var h in Hulls.ToArray()) { h.Dispose(); } foreach (var c in ComponentTemplates.ToArray()) { c.Dispose(); } foreach (var m in Mounts.ToArray()) { m.Dispose(); } foreach (var sst in StarSystemTemplates.ToArray()) { sst.Dispose(); } foreach (var gt in GalaxyTemplates.ToArray()) { gt.Dispose(); } foreach (var h in HappinessModels.ToArray()) { h.Dispose(); } foreach (var c in Cultures.ToArray()) { c.Dispose(); } foreach (var ai in EmpireAIs.ToArray()) { ai.Dispose(); } if (this == Current) { Current = null; } }