public void TestGetAllChemObjects_IReactionSet() { var allObjects = ReactionManipulator.GetAllChemObjects(reaction); // does not recurse beyond the IAtomContainer, so: // reaction, 2xreactant, 1xproduct Assert.AreEqual(4, allObjects.Count()); }
public static IEnumerable <IChemObject> GetAllChemObjects(IReactionSet set) { yield return(set); foreach (var reaction in set) { foreach (var o in ReactionManipulator.GetAllChemObjects(reaction)) { yield return(o); } } yield break; }
public static List <IChemObject> GetAllChemObjects(IReactionSet set) { List <IChemObject> list = new List <IChemObject> { set }; foreach (var reaction in set) { list.AddRange(ReactionManipulator.GetAllChemObjects(reaction)); } return(list); }