Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CONSUMABLE_H_INCLUDED
- #define CONSUMABLE_H_INCLUDED
- #include "Player.h"
- #include "MiniShield.h"
- #include "BigShield.h"
- using namespace std;
- class Consumable{
- public:
- // Variables
- int points;
- string utility;
- // Constructors
- Consumable(){
- points = 0;
- utility="";
- }
- Consumable(int points){
- this->points = points;
- utility = "";
- }
- Consumable(int points, string utility){
- this->points = points;
- this->utility = utility;
- }
- // Methods
- void show(){
- cout << "Points: " << points << endl << "Utility: " << utility << endl;
- }
- };
- // 1. MiniShield
- class MiniShield : public Consumable{
- public:
- // Constructor
- MiniShield() : Consumable(25, "Shield"){};
- //MiniShield(int points, string utility) : Consumable(points, utility){};
- // Methods
- void show(){
- cout << "Mini Shield\n";
- cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
- }
- };
- // 2. BigShield
- class BigShield : public Consumable{
- public:
- // Constructor
- BigShield() : Consumable(50, "Shield"){};
- //Methods
- void show(){
- cout << "Big Shield\n";
- cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
- }
- };
- // 3. Bandage
- class Bandage : public Consumable{
- public:
- // Constructor
- Bandage() : Consumable(15, "Health"){};
- //Methods
- void show(){
- cout << "Bandage\n";
- cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
- }
- };
- // 4. Med Kit
- class MedKit : public Consumable{
- public:
- // Constructor
- MedKit() : Consumable(100, "Health"){};
- //Methods
- void show(){
- cout << "Med Kit\n";
- cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
- }
- };
- // 5. Slurp Juice
- class Slurp : public Consumable{
- public:
- // Constructor
- Slurp() : Consumable(75, "Health And Shield"){};
- //Methods
- void show(){
- cout << "Slurp\n";
- cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
- }
- };
- // 6. Chug Jug
- class ChugJug : public Consumable{
- public:
- // Constructor
- ChugJug() : Consumable(200, "Health And Shield"){};
- //Methods
- void show(){
- cout << "ChugJug\n";
- cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
- }
- };
- #endif // CONSUMABLE_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement