protected void Add(EntitySolverUpdateable solverUpdateable) { if (solverUpdateable.solver == null) { if (solverUpdateable.SolverGroup == null) { solverUpdateables.Add(solverUpdateable); solverUpdateable.SolverGroup = this; solverUpdateable.Solver = solver; OnInvolvedEntitiesChanged(); } else { throw new InvalidOperationException("Cannot add SolverUpdateable to SolverGroup; it already belongs to a SolverGroup."); } } else { throw new InvalidOperationException("Cannot add SolverUpdateable to SolverGroup; it already belongs to a solver."); } }