title: C++ Goodpractice for multiple derived class of the same base class
body: <p>Goal: I am making a program which has 10 pattern styles, which are implemented as different classes that derive from a common pattern base class.
  The main.cpp creates a pattern style depending on the style chosen by the user.</p>
  
  <p>The question:</p>
  
  <p>how can main know about all pattern styles without creating so many headers?</p>
  
  <p>ex : these will be the files if separated. </p>
  
  <pre><code>baseclass.h
  baseclass.cpp
  derivedclass1.h
  derivedclass1.cpp
  derivedclass2.h
  derivedclass2.cpp
  derivedclass3.h
  derivedclass3.cpp
  derivedclass4.h
  derivedclass4.cpp
  main.cpp
  </code></pre>
  
  <p>inside main.cpp:</p>
  
  <pre><code>#include "derivedclass1.h"
  #include "derivedclass2.h"
  #include "derivedclass3.h"
  #include "derivedclass4.h"
  </code></pre>
  
  <p>Isn't this too much? </p>
  
  <p>Is there a way to just call 1 namespace which has a list of of all derived class like unity (deriving in monobehavior)? i know it uses c# but still.. </p>
  
  <p>=====thoughts=====</p>
  
  <p>Maybe a foreach loop that calls all derived class of the same base class? or should I make a <code>main_header.h</code> which <code>#include</code> all the style and include that from <code>main.cpp</code>?</p>