Chapter 13. Advanced OOP – Inheritance and Polymorphism
In this chapter, we will further extend our knowledge of OOP by looking at the slightly more advanced concepts of inheritance and polymorphism. We will then be able to use this new knowledge to implement the star characters of our game, Thomas and Bob. Here is what we will cover in this chapter in a little more detail:
- How to extend and modify a class using inheritance?
- Treating an object of a class as if it is more than one type of class by using polymorphism
- Abstract classes and how designing classes that are never instantiated can actually be useful
- Building an abstract
PlayableCharacter
class - Puting inheritance to work with
Thomas
andBob
classes - Adding Thomas and Bob to the game project