I am trying to make a game with an entity-component-system style. The entity class has a list of different components all extending the Component class. How can I make a functio