In this chapter, we saw how we could design vehicles for a video game in an object-oriented way. We also saw how we could use polymorphism with a class hierarchy. There were several issues with this object-oriented design and most of these drawbacks were directly related to Swift being a single-inheritance language.
In the next chapter, we will look at how we can design the same vehicle types in a protocol-oriented way to see how it addresses the issues we saw with the object-oriented design.