-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTree.cpp
More file actions
35 lines (30 loc) · 710 Bytes
/
Tree.cpp
File metadata and controls
35 lines (30 loc) · 710 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
#include "Tree.h"
Tree::Tree(){
age = 0;
initialAge = 0;
}
std::string Tree::blossomDesc(){
if (blossom == false)
return "resting";
else
return "blossoming";
}
std::string Tree::treeAge(){
if (age <= 200)
return "sapling";
else if (age > 200 && age <= 400)
return "thin branch in the ground";
else if (age > 400)
return "tree";
}
std::string Tree::treeHealth(){
if (thirst == 0)
printf("wilting");
if (thirst > 0 && thirst <= 50)
printf("sunlight is poking through holes in the leaves.");
if (thirst > 50)
printf("filtering light through it's leaves");
}
void Tree::updateTreeAge(int time){
age = time;
}