Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CPLAYER_H
- #define CPLAYER_H
- #include "cSquare.h"
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- #pragma once
- class cPlayer
- {
- private:
- string playerName;
- float playerBalance;
- int currentPosition;
- public:
- cPlayer(string, float, int);
- void setPlayerName(string);
- void setPlayerBalance(float);
- void setPosition(int);
- string getPlayerName();
- float getPlayerBalance();
- int getCurrentPosition();
- virtual ~cPlayer();
- };
- #endif
- #ifndef CSQUARE_H
- #define CSQUARE_H
- #include "cPlayer.h"
- #include <string>
- #include <iostream>
- #include <vector>
- using namespace std;
- #pragma once
- class cSquare
- {
- protected:
- int identificationNum;
- string cardName;
- public:
- //Used To Create The Base Class With The Parameter Of An Int And A String.
- cSquare(int, string);
- //Used So That All Dervied Classes Can Output Their Name(cardName)
- string getName();
- //Tells The Compiler That Each Class Should Have A do_method Method However This One Does Not.
- virtual void do_method(cPlayer&, cPlayer&) = 0;
- //Allows The Class To Individually Call Their Own GetName Method As this Refers To A Pointer
- string printName() { return this->getName(); }
- // Overloading Of The SetName Method Occurs Below. They Take One, Two or Three Parameters And Are Used
- // Different Depending On The Class Which Is Using Them.
- void setName(string);
- void setName(string, string);
- void setName(string, string, string);
- // Used By All Classes To Set The IdentificationNum
- void setIdentificationNum(int);
- // Used To Retrieve The Class' IdentificationNum
- int getIdentificationNum();
- virtual ~cSquare();
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement