def do(actor, targets)
    return if targets.empty?
    #If next item is a collection of prototypes, copy them all in at once.
    if prototypes[@prototype_index].respond_to?(:each)
      prototypes[@prototype_index].each do |prototype|
        actor.environment.add_object(generate_child(actor, prototype, targets[@target_index]))
      end
    #Otherwise copy the single prototype.
    else
      targets[@target_index].environment.add_object(generate_child(actor, prototypes[@prototype_index], targets[@target_index]))
    end
    #Move to next target and prototype group, wrapping to start of array if need be.
    @target_index = (@target_index + 1) % targets.length
    @prototype_index = (@prototype_index + 1) % prototypes.length
  end
def do(actor, targets)
    return if targets.empty?
    #If next item is a collection of prototypes, copy them all in at once.
    if prototypes[@prototype_index].respond_to?(:each)
      prototypes[@prototype_index].each do |prototype|
        actor.environment.add_object(generate_child(actor, prototype, targets[@target_index]))
      end
    #Otherwise copy the single prototype.
    else
      targets[@target_index].environment.add_object(generate_child(actor, prototypes[@prototype_index], targets[@target_index]))
    end
    #Move to next target and prototype group, wrapping to start of array if need be.
    @target_index = (@target_index + 1) % targets.length
    @prototype_index = (@prototype_index + 1) % prototypes.length
  end
Copies next prototype into environment.