Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class cooperative : public board_game {
- private:
- int id;
- protected:
- bool traitor;
- public:
- cooperative (int, int, bool, int);
- void MO(list <cooperative> e_objects);
- void DO(list <cooperative> e_objects);
- void MDO(list <cooperative> e_objects);
- void DIR(list <cooperative> e_objects);
- void SHOW(list <cooperative> e_objects);
- };
- cooperative::cooperative(int players, int pawns, bool traitor_mo, int id_number) {
- id = id_number;
- number_of_players = players;
- number_of_pawns = pawns;
- traitor = traitor_mo;
- }
- void cooperative::MO(list <cooperative> e_objects) {
- int id;
- bool traitor;
- int players;
- int pawns;
- cout << "Liczba graczy:" << endl;
- cin >> players;
- cout << "Liczba pionków:" << endl;
- cin >> pawns;
- cout << "Czy obecny jest zdrajca? (1 - tak, 0 - nie)" << endl;
- cin >> traitor;
- if (!e_objects.empty()) {
- id = 1;
- } else {
- id = e_objects.back().id + 1;
- }
- cooperative a (players, pawns, traitor, id);
- e_objects.push_back(a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement