-
Notifications
You must be signed in to change notification settings - Fork 0
/
Team.h
84 lines (65 loc) · 2.03 KB
/
Team.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef TEAM_H
#define TEAM_H
/* Team.h
*
* Team
*
* by Guthrie Tabios
* tabiosg
* 2021-04-01
*/
#include "Fighter.h"
#include <string>
#include <vector>
class Team
{
public:
Team();
Team(const Team &other);
Team &operator=(const Team &rhs);
// EFFECTS return total size of team
int getTotalSize() const;
// EFFECTS return true if team is in brawl, returns false otherwise.
bool getBrawlStatus() const;
// REQUIRES 0 <= k < inCombatFighters in team
// EFFECTS return the kth inCombat fighter.
Fighter *getFighterK(const int &k) const;
// EFFECTS return all fighters
std::vector<Fighter *> getAllFighters();
// REQUIRES team is in combat
// EFFECTS return true if all members are out of combat.
bool areAllMembersDead() const;
// EFFECTS Prints all fighters to stream as "Fighter 1: Alex"
// followed by newline and then "Fighter 2: Harry"
std::ostream &printAllFighters(std::ostream &os);
// REQUIRES team is in combat
// EFFECTS return size of team in combat
int getInCombatSize() const;
// EFFECTS Prints in combat fighters to stream as "Fighter 1: Alex"
// followed by newline and then "Fighter 2: Harry"
std::ostream &printInCombatFighters(std::ostream &os) const;
// REQUIRES team is not in combat
// EFFECTS makes the team enter a brawl. changes inCombatFighters
void enterBrawl();
// REQUIRES team is in combat and member is exiting combat due to lack of health.
// EFFECTS makes a member exit combat
// This changes inCombatFighters
// and changes inCombatSize.
void memberExitsCombat(const int &k);
// REQUIRES team is in combat
// EFFECTS makes the team exit a brawl.
// changes inCombatFighters.
void exitBrawl();
// REQUIRES team is not in combat
// EFFECTS add fighter to team
void addMember(Fighter *fighter);
// REQUIRES team is not in combat
// EFFECTS remove fighter from team
void removeMember(int &fighterIndex);
~Team();
private:
int totalSize;
bool inBrawl;
std::vector<Fighter *> allFighters;
};
#endif