using System.Collections.Generic;
public static void Main(string[] args)
var components = new List<Component>();
components.Add(Component.CreateComponent<AndNode>("Test Identifier"));
components.Add(Component.CreateComponent<InputBit>("Test Identifier", 1));
public string Identifier { get; set; }
public static T CreateComponent<T>(string identifier, int inputType = 0) where T : Component, new()
if (component is InputBit)
(component as InputBit).InputType = inputType;
public class InputBit : Component
public int InputType { get; set; }
public class AndNode : Component