Skip to content

Example of using inheritance and polymorphism with 8 various classes. Use of classes exemplified through story-based text progression, in which an otherwise peaceful town is ravaged by wolves. Citizens can make small talk and pay taxes. As in real life, citizens are expected to hold jobs, which is represented by a Job class. Classes are implemen…

Notifications You must be signed in to change notification settings

simeng-yang/PolyTown

Repository files navigation

PolyTown

Example of using inheritance and polymorphism with 8 various classes. Use of classes exemplified through story-based text progression, in which an otherwise peaceful town is ravaged by wolves. Citizens can make small talk and pay taxes. As in real life, citizens are expected to hold jobs, which is represented by a Job class.

Classes are implemented in separate .h header and .cpp source files. There are two base classes - Citizen and Wolves, with Citizen having child classes Human and Others. Human and Others have their own respective derivative classes, including Vampire, Nobbs, Zombie, Troll and Dwarf. Furthermore, the Werewolf class exhibits multiple inheritance with respect to two parent classes, Human and Wolf, a feature more unique to C++.

Attached in "Example Output" is example text output of a given run of the program.

About

Example of using inheritance and polymorphism with 8 various classes. Use of classes exemplified through story-based text progression, in which an otherwise peaceful town is ravaged by wolves. Citizens can make small talk and pay taxes. As in real life, citizens are expected to hold jobs, which is represented by a Job class. Classes are implemen…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages