Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CPLAYER_H
- #define CPLAYER_H
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- class cSquare;
- class cPlayer
- {
- private:
- string playerName;
- float playerBalance;
- int currentPosition;
- vector<cSquare*>& vOwnedProperties;
- protected:
- cSquare* cSquareRecieved;
- public:
- cSquare* getcSquare();
- cPlayer(string, float, int);
- void setPlayerName(string);
- void setPlayerBalance(float);
- void setPropertyOwnership(vector<cSquare*>&);
- void setPosition(int);
- string getPlayerName();
- float getPlayerBalance();
- int getCurrentPosition();
- virtual ~cPlayer();
- };
- #endif
- #include "cPlayer.h"
- //This Is The Constructor For The Class File
- //It Creates It's Name, Balance And Its Location.
- cPlayer::cPlayer(string inputPlayerName, float inputPlayerBalance, int inputCurrentLocation)
- {
- setPlayerBalance(inputPlayerBalance);
- setPlayerName(inputPlayerName);
- setPosition(inputCurrentLocation);
- }
- void cPlayer::setPropertyOwnership(vector<cSquare*>& vOwnedProperties)
- {
- }
- //Sets The Player's Name To The Inputted Value
- void cPlayer::setPlayerName(string inputPlayerName)
- {
- playerName = inputPlayerName;
- }
- //Sets The Player's Balance To The Inputted Value
- void cPlayer::setPlayerBalance(float inputPlayerBalance)
- {
- playerBalance = inputPlayerBalance;
- }
- //Sets The Player's Position To The Inputted Value
- void cPlayer::setPosition(int inputPlayerPosition)
- {
- currentPosition = inputPlayerPosition;
- }
- //Returns The Player's Balance
- string cPlayer::getPlayerName()
- {
- return playerName;
- }
- //Returns The Player's Balance
- float cPlayer::getPlayerBalance()
- {
- return playerBalance;
- }
- //Returns The Player's Position
- int cPlayer::getCurrentPosition()
- {
- return currentPosition;
- }
- cPlayer::~cPlayer()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement