Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Item
- {
- public:
- // Various item types
- class Gold;
- class Weapon;
- class Equipment;
- public:
- // Item type identifier
- enum Type
- {
- Gold = 0,
- Weapon = 1,
- Equipment = 2
- };
- public:
- // Members
- Type ItemType;
- public:
- // Methods
- virtual Void Loot();
- };
- class Item::Gold : public Item
- {
- public:
- // Members
- UInt Value;
- public:
- Void Loot(const Player& player) { Player.Gold += Value; };
- };
- class Item::Weapon : public Item
- {
- public:
- enum Type
- {
- Sword = 0,
- Mace = 1
- };
- public:
- // Members
- Type WeaponType;
- };
- class Item::Equipment : public Item
- {
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement