Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.65 KB | None | 0 0
  1. #ifndef CPLAYER_H
  2. #define CPLAYER_H
  3.  
  4. #include "cSquare.h"
  5. #include <iostream>
  6. #include <string>
  7. #include <vector>
  8.  
  9. using namespace std;
  10.  
  11. #pragma once
  12. class cPlayer
  13. {
  14. private:
  15.     string playerName;
  16.     float playerBalance;
  17.     int currentPosition;
  18.  
  19. public:
  20.     cPlayer(string, float, int);
  21.     void setPlayerName(string);
  22.     void setPlayerBalance(float);
  23.     void setPosition(int);
  24.     string getPlayerName();
  25.     float getPlayerBalance();
  26.     int getCurrentPosition();
  27.     virtual ~cPlayer();
  28. };
  29. #endif
  30.  
  31. #ifndef CSQUARE_H
  32. #define CSQUARE_H
  33. #include "cPlayer.h"
  34.  
  35. #include <string>
  36. #include <iostream>
  37. #include <vector>
  38. using namespace std;
  39. #pragma once
  40. class cSquare
  41. {
  42. protected:
  43.     int identificationNum;
  44.     string cardName;
  45. public:
  46.     //Used To Create The Base Class With The Parameter Of An Int And A String.
  47.     cSquare(int, string);
  48.     //Used So That All Dervied Classes Can Output Their Name(cardName)
  49.     string getName();
  50.     //Tells The Compiler That Each Class Should Have A do_method Method However This One Does Not.
  51.     virtual void do_method(cPlayer&, cPlayer&) = 0;
  52.     //Allows The Class To Individually Call Their Own GetName Method As this Refers To A Pointer
  53.     string printName() { return this->getName(); }
  54.     // Overloading Of The SetName Method Occurs Below. They Take One, Two or Three Parameters And Are Used
  55.     // Different Depending On The Class Which Is Using Them.
  56.     void setName(string);
  57.     void setName(string, string);
  58.     void setName(string, string, string);
  59.     // Used By All Classes To Set The IdentificationNum
  60.     void setIdentificationNum(int);
  61.     // Used To Retrieve The Class' IdentificationNum
  62.     int getIdentificationNum();
  63.     virtual ~cSquare();
  64. };
  65. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement