Construct Compound
This commit is contained in:
@@ -171,14 +171,16 @@ public abstract class BaseBond
|
|||||||
bond.StructureChanged();
|
bond.StructureChanged();
|
||||||
if (Atom.Compound.Atoms.Contains(bond.Atom))
|
if (Atom.Compound.Atoms.Contains(bond.Atom))
|
||||||
return;
|
return;
|
||||||
bond.Atom.HomogeneousMixture.Compounds.Remove(bond.Atom.Compound);
|
|
||||||
bond.Atom.Compound.Amount = 0d;
|
|
||||||
|
|
||||||
|
Compound r = bond.Atom.Compound;
|
||||||
foreach (BaseAtom atom in bond.Atom.Compound.Atoms.ToHashSet())
|
foreach (BaseAtom atom in bond.Atom.Compound.Atoms.ToHashSet())
|
||||||
{
|
{
|
||||||
Atom.Compound.Atoms.Add(atom);
|
Atom.Compound.Atoms.Add(atom);
|
||||||
atom.Compound = Atom.Compound;
|
atom.Compound = Atom.Compound;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r.Amount = 0d;
|
||||||
|
r.HomogeneousMixture.Compounds.Remove(r);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// disconnect with connected bond
|
/// disconnect with connected bond
|
||||||
|
|||||||
Reference in New Issue
Block a user