OnAdditionToSolver() public method

Called when the updateable is added to a solver.
public OnAdditionToSolver ( Solver newSolver ) : void
newSolver Solver Solver to which the updateable was added.
return void
Beispiel #1
0
 ///<summary>
 /// Adds a solver updateable to the solver.
 ///</summary>
 ///<param name="item">Updateable to add.</param>
 ///<exception cref="ArgumentException">Thrown when the item already belongs to a solver.</exception>
 public void Add(SolverUpdateable item)
 {
     if (item.Solver == null)
     {
         item.Solver      = this;
         item.solverIndex = solverUpdateables.count;
         solverUpdateables.Add(item);
         DeactivationManager.Add(item.simulationIslandConnection);
         item.OnAdditionToSolver(this);
     }
     else
     {
         throw new ArgumentException("Solver updateable already belongs to something; it can't be added.", "item");
     }
 }
Beispiel #2
0
 ///<summary>
 /// Adds a solver updateable to the solver.
 ///</summary>
 ///<param name="item">Updateable to add.</param>
 ///<exception cref="ArgumentException">Thrown when the item already belongs to a solver.</exception>
 public void Add(SolverUpdateable item)
 {
     if (item.Solver == null)
     {
         item.Solver = this;
         item.solverIndex = solverUpdateables.Count;
         solverUpdateables.Add(item);
         DeactivationManager.Add(item.simulationIslandConnection);
         item.OnAdditionToSolver(this);
     }
     else
         throw new ArgumentException("Solver updateable already belongs to something; it can't be added.", "item");
 }