Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/23/09 16:43:34 (14 years ago)
Author:
swagner
Message:

Refactored cloning (#806)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/3.3/VariableInjector.cs

    r2520 r2526  
    5353    /// Clones the current instance (deep clone).
    5454    /// </summary>
    55     /// <remarks>Deep clone performed with <see cref="Auxiliary.Clone"/> of helper class
     55    /// <remarks>Deep clone performed with <see cref="cloner.Clone"/> of helper class
    5656    /// <see cref="Auxiliary"/>.</remarks>
    5757    /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param>
    5858    /// <returns>The cloned object as <see cref="VariableInjector"/>.</returns>
    59     public override object Clone(IDictionary<Guid, object> clonedObjects) {
     59    public override IItem Clone(ICloner cloner) {
    6060      VariableInjector clone = new VariableInjector();
    61       clonedObjects.Add(Guid, clone);
     61      cloner.RegisterClonedObject(this, clone);
    6262      clone.Name = Name;
    6363      foreach (IVariable variable in Variables)
    64         clone.AddVariable((IVariable)Auxiliary.Clone(variable, clonedObjects));
     64        clone.AddVariable((IVariable)cloner.Clone(variable));
    6565      return clone;
    6666    }
Note: See TracChangeset for help on using the changeset viewer.