Now we will code an interface to suit each of the components that will make up all the different game objects we have just coded the specifications for. We will not code a different interface for each different component type, rather we will code generic types that relate to them all. Allowing all the different types of update and graphics component to be used polymorphically in our code – as we did in the previous project.
Therefore, we will need an update component interface and a graphics component interface.
Note
You can use copy & paste as you did in the previous section, just be sure to examine the code and understand it to avoid confusion later in the project.
Let's start with the graphics component.