Advertisement
makispaiktis

Player.h

Mar 23rd, 2019 (edited)
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.53 KB | None | 0 0
  1. #ifndef PLAYER_H_INCLUDED
  2. #define PLAYER_H_INCLUDED
  3.  
  4. using namespace std;
  5.  
  6. class Player{
  7.  
  8. public:
  9.     // Variables
  10.     string skin;
  11.     string backpack;
  12.     unsigned int health;
  13.     unsigned int shield;
  14.  
  15.     // Constructors
  16.     Player(){
  17.         skin = "A.I.M.";
  18.         backpack = "E.L.I.M.";
  19.         health = 1;
  20.         shield = 0;
  21.     }
  22.  
  23.     Player(string skin){
  24.         this->skin = skin;
  25.         backpack = "E.L.I.M.";
  26.         health = 1;
  27.         shield = 0;
  28.     }
  29.  
  30.     Player(string skin, string backpack){
  31.         this->skin = skin;
  32.         this->backpack = backpack;
  33.         health = 1;
  34.         shield = 0;
  35.     }
  36.  
  37.     Player(string skin, string backpack, unsigned  int health){
  38.         this->skin = skin;
  39.         this->backpack = backpack;
  40.         this->health = health;
  41.         shield = 0;
  42.     }
  43.  
  44.     Player(string skin, string backpack, unsigned int health, unsigned int shield){
  45.         this->skin = skin;
  46.         this->backpack = backpack;
  47.         this->health = health;
  48.         this->shield = shield;
  49.     }
  50.  
  51.     // Methods
  52.     void displayPlayerStars(unsigned int n){
  53.     for(unsigned int i=0; i<n; i++){
  54.         cout << "*";
  55.     }
  56.     cout << endl;
  57. }
  58.  
  59.     void show(){
  60.         displayPlayerStars(34);
  61.         cout << "****   Your Player's info:    ****\n";
  62.         cout << "Skin: " << skin << endl << "Backpack: " << backpack << endl;
  63.         cout << "Health: " << health << endl << "Shield: " << shield << endl;
  64.         displayPlayerStars(34);
  65.     }
  66.  
  67. };
  68.  
  69. #endif // PLAYER_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement