1234567891011121314151617181920212223242526272829 |
- #include "qwixx.h"
- #include "dice.h"
- #include "playerCard.h"
- class Game {
- public:
- std::vector<PlayerCard> players;
- int state;
- Dice dice;
-
- bool addPlayer(std::string name);
- };
- Game::Game() {
-
- state = NOT_STARTED;
-
- };
- bool Game::addPlayer(std::string name){
- if (NOT_STARTED == state){
- PlayerCard newplayer(name);
- players.push_back(newplayer);
- fprintf (stdout, "added: %s to the game", name);
- return true;
- }
- else{
- fprintf(stdout, "player %s was not added to the game", name);
- return false;
- }
- };
|