Back to code to finish up

Having everything set in the editor and level, we have a few more code changes to make. First, we make some changes in MasteringInventory.h:

struct FWeaponProperties
        TSubclassOf<class AMasteringWeapon> WeaponClass;
        int WeaponPower;
        int Ammo;

We add this struct to the very top of the file, just after the #include header section. We will use this in the inventory list to reference weapons from now on, instead of referencing the MasteringWeapon class itself directly (but, of course, this is now a member in the struct for our use). We use the struct to track two new properties we associate with weapons: ammo and weapon power.

Next, after ...

Get Mastering Game Development with Unreal Engine 4 - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.