title: Make native C++ Code to a Blueprint in UE4
body: <p>I'm new at UE4, so if I do something horrible wrong, tell it to me. I'm happy about everything I can learn</p>
  <p>The question: is it Possible to make a Blueprint out of a normal C++ class? It should - with the right includes -
  because I made a C++ class &quot;Graph&quot; for the University, and I like to implement it in to a game as base of a Skill-Tree.
  It should be &quot;UCLASS(Blueprintable)&quot; to make it simple and clear to read. And also Native, course I do the Garbage collection for the System :)</p>
  <p>The code is this:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;list&gt;
  
  template&lt;class T&gt;
  class Graph
  {
  
  
  public:
      T element;
      std::list&lt;Graph&lt;T&gt;*&gt; childs;
      std::list&lt;Graph&lt;T&gt;*&gt; parents;
      Graph();
      Graph(T);
      ~Graph();
      Graph&lt;T&gt;* makeNewChild(T);
      bool pushChildtoParent(Graph&lt;T&gt;*);
      Graph&lt;T&gt;* makeNewChild(Graph&lt;T&gt;*);
      bool deleteChild(Graph&lt;T&gt;*);
      bool makeParent(Graph&lt;T&gt;*);
      T getElement();
      bool leaf;
  };
  
  template&lt;class T&gt;
  Graph&lt;T&gt;::Graph()
  {
      leaf = true;
      element = nullptr;
  }
  
  template&lt;class T&gt;
  Graph&lt;T&gt;::Graph(T element) : element(element)
  {
      leaf = true;
  }
  
  template&lt;class T&gt;
  Graph&lt;T&gt;::~Graph()
  {
      if(!leaf)
          {
              for (auto it = childs.begin(); it != childs.end();)
              {
                  // wenn das kind nicht mehrere Väter hat, denen ich es nicht weg nehmen will
                  if ((**it).parents.size()&lt;2)
                  {
                       delete *it ++;
                  }
                  else{
                      (**it).parents.remove(this);
                      it ++;
                  }
              }
          }
      if (!(*this).parents.empty())
      {
           for (auto it = parents.begin(); it != parents.end(); it++)
          {
              //alle Väter vergessen dieses Kind, damit es ohne folgen beseitigt werden kann
              (**it).deleteChild(this);
          }
      }
  }
  
  template&lt;class T&gt;
  T Graph&lt;T&gt;::getElement()
  {
      return (*this).element;
  }
  
  template&lt;class T&gt;
  bool Graph&lt;T&gt;::deleteChild(Graph&lt;T&gt;* tokill)
  {
      for (auto it = childs.begin(); it != childs.end(); it++)
      {
          if( (*it)==tokill){
              childs.erase(it);
              return true;
          }
      }
      // Error code hier einfügen
      std::cout&lt;&lt;&quot;Leider dieses Kind nicht gefunden. Error main2.h at line 61&quot;&lt;&lt;std::endl;
      return false;
  }
  
  //eingane der zu setzende Vater. Wenn setzen des Vaters gelingt, wird er in die Liste der Väter aufgenommen
  
  template&lt;class T&gt;
  bool Graph&lt;T&gt;::makeParent (Graph&lt;T&gt;* newParent){
      if ((*newParent).pushChildtoParent(this)){
          parents.push_back(newParent);
          return true;
      }
      else{
          //Error code hier einfügen
          std::cout&lt;&lt;&quot;das Erzeugen dieses Kindes bei dem Vater war nicht möglich. Error main2.h at line 76&quot;&lt;&lt;std::endl;
          return false;
      }
  }
  
  template&lt;class T&gt;
  bool Graph&lt;T&gt;::pushChildtoParent(Graph&lt;T&gt;* inTree){
      childs.push_back(inTree);
      leaf = false;
      return true;
  }
  
  template&lt;class T&gt;
  Graph&lt;T&gt;* Graph&lt;T&gt;::makeNewChild(T inValue)
  {
      Graph&lt;T&gt;* contain = new Graph&lt;T&gt;(inValue);
      childs.push_back(contain);
      (*contain).parents.push_back(this);
      leaf = false;
      return contain;
  }
  
  template&lt;class T&gt;
  Graph&lt;T&gt;* Graph&lt;T&gt;::makeNewChild(Graph&lt;T&gt;* inTree)
  {
      childs.push_back(inTree);
      (*inTree).parents.push_back(this);
      leaf = false;
      return inTree;
  }
  </code></pre>
  <p>Or should I rewrite it, with out the Template?
  course I'm sure, the type T will be &quot; Skill* &quot;</p>
  <p>I think making on this point Blueprints will make the effort for the after develop balancing from skills and so on better, faster and easy to handle.</p>
  <p>It would be nice if you can help me on this point.</p>