Advertisement
makispaiktis

Consumable.h

Mar 23rd, 2019 (edited)
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.56 KB | None | 0 0
  1. #ifndef CONSUMABLE_H_INCLUDED
  2. #define CONSUMABLE_H_INCLUDED
  3.  
  4. #include "Player.h"
  5. #include "MiniShield.h"
  6. #include "BigShield.h"
  7.  
  8. using namespace std;
  9.  
  10. class Consumable{
  11.  
  12. public:
  13.     // Variables
  14.     int points;
  15.     string utility;
  16.  
  17.     // Constructors
  18.     Consumable(){
  19.         points = 0;
  20.         utility="";
  21.     }
  22.  
  23.     Consumable(int points){
  24.         this->points = points;
  25.         utility = "";
  26.     }
  27.  
  28.     Consumable(int points, string utility){
  29.         this->points = points;
  30.         this->utility = utility;
  31.     }
  32.  
  33.     // Methods
  34.     void show(){
  35.         cout << "Points: " << points << endl << "Utility: " << utility << endl;
  36.     }
  37. };
  38.  
  39.  
  40. // 1. MiniShield
  41. class MiniShield : public Consumable{
  42.  
  43. public:
  44.     // Constructor
  45.     MiniShield() : Consumable(25, "Shield"){};
  46.     //MiniShield(int points, string utility) : Consumable(points, utility){};
  47.     // Methods
  48.     void show(){
  49.         cout << "Mini Shield\n";
  50.         cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
  51.     }
  52.  
  53. };
  54.  
  55.  
  56.  
  57. // 2. BigShield
  58. class BigShield : public Consumable{
  59.  
  60. public:
  61.     // Constructor
  62.     BigShield() : Consumable(50, "Shield"){};
  63.     //Methods
  64.     void show(){
  65.         cout << "Big Shield\n";
  66.         cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
  67.     }
  68.  
  69. };
  70.  
  71.  
  72.  
  73. // 3. Bandage
  74. class Bandage : public Consumable{
  75.  
  76. public:
  77.     // Constructor
  78.     Bandage() : Consumable(15, "Health"){};
  79.     //Methods
  80.     void show(){
  81.         cout << "Bandage\n";
  82.         cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
  83.     }
  84.  
  85. };
  86.  
  87.  
  88.  
  89. // 4. Med Kit
  90. class MedKit : public Consumable{
  91.  
  92. public:
  93.     // Constructor
  94.     MedKit() : Consumable(100, "Health"){};
  95.     //Methods
  96.     void show(){
  97.         cout << "Med Kit\n";
  98.         cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
  99.     }
  100.  
  101. };
  102.  
  103.  
  104. // 5. Slurp Juice
  105. class Slurp : public Consumable{
  106.  
  107. public:
  108.     // Constructor
  109.     Slurp() : Consumable(75, "Health And Shield"){};
  110.     //Methods
  111.     void show(){
  112.         cout << "Slurp\n";
  113.         cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
  114.     }
  115.  
  116. };
  117.  
  118.  
  119.  
  120.  
  121.  
  122. // 6. Chug Jug
  123. class ChugJug : public Consumable{
  124.  
  125. public:
  126.     // Constructor
  127.     ChugJug() : Consumable(200, "Health And Shield"){};
  128.     //Methods
  129.     void show(){
  130.         cout << "ChugJug\n";
  131.         cout << "Points: " << points << "\n" << "Utility: " << utility << endl << endl;
  132.     }
  133.  
  134. };
  135.  
  136.  
  137.  
  138. #endif // CONSUMABLE_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement