Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. #ifndef CPLAYER_H
  2. #define CPLAYER_H
  3.  
  4. #include <iostream>
  5. #include <string>
  6. #include <vector>
  7.  
  8. using namespace std;
  9.  
  10. class cSquare;
  11.  
  12. class cPlayer
  13. {
  14. private:
  15. string playerName;
  16. float playerBalance;
  17. int currentPosition;
  18. vector<cSquare*>& vOwnedProperties;
  19. protected:
  20. cSquare* cSquareRecieved;
  21. public:
  22. cSquare* getcSquare();
  23. cPlayer(string, float, int);
  24. void setPlayerName(string);
  25. void setPlayerBalance(float);
  26. void setPropertyOwnership(vector<cSquare*>&);
  27. void setPosition(int);
  28. string getPlayerName();
  29. float getPlayerBalance();
  30. int getCurrentPosition();
  31. virtual ~cPlayer();
  32. };
  33. #endif
  34.  
  35. #include "cPlayer.h"
  36. //This Is The Constructor For The Class File
  37. //It Creates It's Name, Balance And Its Location.
  38. cPlayer::cPlayer(string inputPlayerName, float inputPlayerBalance, int inputCurrentLocation)
  39. {
  40. setPlayerBalance(inputPlayerBalance);
  41. setPlayerName(inputPlayerName);
  42. setPosition(inputCurrentLocation);
  43. }
  44. void cPlayer::setPropertyOwnership(vector<cSquare*>& vOwnedProperties)
  45. {
  46.  
  47. }
  48. //Sets The Player's Name To The Inputted Value
  49. void cPlayer::setPlayerName(string inputPlayerName)
  50. {
  51. playerName = inputPlayerName;
  52. }
  53. //Sets The Player's Balance To The Inputted Value
  54. void cPlayer::setPlayerBalance(float inputPlayerBalance)
  55. {
  56. playerBalance = inputPlayerBalance;
  57. }
  58. //Sets The Player's Position To The Inputted Value
  59. void cPlayer::setPosition(int inputPlayerPosition)
  60. {
  61. currentPosition = inputPlayerPosition;
  62. }
  63. //Returns The Player's Balance
  64. string cPlayer::getPlayerName()
  65. {
  66. return playerName;
  67. }
  68. //Returns The Player's Balance
  69. float cPlayer::getPlayerBalance()
  70. {
  71. return playerBalance;
  72. }
  73. //Returns The Player's Position
  74. int cPlayer::getCurrentPosition()
  75. {
  76. return currentPosition;
  77. }
  78.  
  79. cPlayer::~cPlayer()
  80. {
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement