-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathavatar.cpp
More file actions
executable file
·45 lines (35 loc) · 847 Bytes
/
avatar.cpp
File metadata and controls
executable file
·45 lines (35 loc) · 847 Bytes
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
//avatar.cpp
//max smiley
//program # 3
//cs202
#include "avatar.h"
//default constructor
Avatar::Avatar(): name("no name given"), bio("no bio given"){}
//constructor actually used in main.
Avatar::Avatar(String in_name, String in_bio): name(in_name), bio(in_bio){}
void Avatar::change_name(String new_name)
{
name = new_name;
}
void Avatar::change_bio(String new_bio)
{
bio = new_bio;
}
//this adds an Object to the tools tree.
void Avatar::add_tool(Object& in)
{
tools.add(in);
}
//this adds an Object to the chars tree.
void Avatar::add_characteristic(Object& in)
{
chars.add(in);
}
//prints the whole avatar.
void Avatar::print(ostream& out)
{
out << "Name: " << name << endl;
out << "Bio: " << bio << endl;
out << "********TOOLS********" << endl << tools << endl;
out << "***CHARACTERISTICS***" << endl << chars << endl;
}