internal Isotope AddIsotope(int atomicNumber, double atomicMass, float abundance)
{
var isotope = new Isotope(this, atomicNumber, atomicMass, abundance);
if (Isotopes.ContainsKey(atomicNumber))
return isotope;
Isotopes.Add(atomicNumber, isotope);
TotalAbundance += abundance;
_totalMass += abundance*atomicMass;
AverageMass = _totalMass/TotalAbundance;
if (PrincipalIsotope != null && !(abundance > PrincipalIsotope.RelativeAbundance))
return isotope;
if (PrincipalIsotope != null)
{
PrincipalIsotope.IsPrincipalIsotope = false;
}
PrincipalIsotope = isotope;
PrincipalIsotope.IsPrincipalIsotope = true;
return isotope;
}