AIMA.Core.Agent.Impl.ObjectWithDynamicAttributes.copy C# (CSharp) Method

copy() public method

public copy ( ) : ObjectWithDynamicAttributes
return ObjectWithDynamicAttributes
	public ObjectWithDynamicAttributes copy() {
		ObjectWithDynamicAttributes copy = null;

		try {
			copy = (ObjectWithDynamicAttributes)this.GetType().GetConstructor(System.Type.EmptyTypes).Invoke(null);
            foreach (object val in attributes)
            {
                copy.attributes.Add(val, attributes[val]);
            }
		} catch (Exception ex) {
			Debug.WriteLine(ex.ToString());
		}

		return copy;
	}