Now that we have created our weapon system, it is time for us to create an ammunition system. Ammunition is what our weapons use to cause damage. It can be anything from a bullet to a magic spell, anything that results in damage caused by firing some weapon. Since we wish to achieve a modular and extensible design, we will accomplish this using interfaces once again.
Since we need our game to support many ammunition types and we want to write clean, modular, OOP C++ code, it is essential that we create an ammo interface which we will call
IAmmo. Let's do it:
IAmmo.hthat will hold our
IAmmointerface declaration. It should look like this:
#ifndef __IAMMO_HEADER__ #define __IAMMO_HEADER__ ...