Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <dos.h>
- #include <stdio.h>
- #include "Player.h"
- class Team
- {
- public:
- Team(int teamNum);
- ~Team();
- int PlayQuarter();
- void TeamName();
- void PrintTeamStats();
- private:
- char teamName[20];
- int currentTeam;
- Player * player[5];
- int teamScore;
- };
- Team::Team(int teamNum)
- {
- int i;
- teamScore = 0;
- currentTeam = teamNum;
- text_colour(f_gray, b_black);
- cout<<endl;
- cout<<"Team "<<teamNum+1<<" name? "<<endl;
- text_colour(f_white, b_black);
- cin.getline(teamName, 20, '\n');
- cout<<endl;
- for(i=0; i<5; i++)
- player[i] = new Player(i);
- }
- Team::~Team()
- {
- }
- int Team::PlayQuarter()
- {
- int currentPlayer = rand()%5;
- int shit;
- shit = player[currentPlayer]->TakeShot();
- cout<<"The returned value is "<<shit<<endl;
- //teamScore += player[currentPlayer]->TakeShot();
- teamScore += shit;
- return teamScore;
- }
- void Team::TeamName()
- {
- cout<<teamName;
- }
- void Team::PrintTeamStats()
- {
- cout<<"Team "<<teamName<<"'s stats "<<endl;
- for (int i=0; i<5; i++)
- player[i]->Printout();
- }
Add Comment
Please, Sign In to add comment