/// <summary> /// Constructor by parameters /// </summary> /// <param name="parameters">Node parameters</param> public Node(NodeParams parameters) { // TODO: Implement a class ID = parameters.ID; RefCSysID = parameters.RefCSysID; AnalysisCSysID = parameters.AnalysisCSysID; Coords = parameters.Coords; ParentElementIDs = IntSet.FromArray(parameters.ParentElementIDs); // Type = parameters.TypeName; }
/// <summary> /// Returns the specific creator of the node using the data contained in the passed parameters /// </summary> /// <param name="parameters">Node parameters</param> /// <returns>A specific instance of the node creator</returns> public static NodeCreator GetNodeCreatorByParams(NodeParams parameters) { NodeCreator creator = null; var type = parameters.TypeName; // TODO: Hide the implementation of selecting a specific creator, so that the registration of a specific type occurs somewhere in a separate place if (type == null) { creator = new NodeCreator(parameters); } else if (type != null) { // Do nothing } // TODO: Insert new type of nodes return(creator); }
/// <summary> /// Protected base constructor for implementing abstract parameter passing when creating a specific node class. /// </summary> /// <param name="parameters">Node parameters</param> protected NodeCreator(NodeParams parameters) { nodeParameters = parameters; }