Add support of leaves

This commit is contained in:
Aurélie Delhaie
2022-10-16 17:36:47 +02:00
parent 6a44c4afd9
commit fd4b766c4d
14 changed files with 219 additions and 77 deletions

View File

@@ -61,6 +61,37 @@ double Week::total() {
return mon->get_total() + tue->get_total() + wed->get_total() + thu->get_total() + fri->get_total();
}
double Week::total(Week *wtemplate)
{
double t = 0.0;
if (mon->not_working()) {
t += wtemplate->mon->get_total();
} else {
t += mon->get_total();
}
if (tue->not_working()) {
t += wtemplate->tue->get_total();
} else {
t += tue->get_total();
}
if (wed->not_working()) {
t += wtemplate->wed->get_total();
} else {
t += wed->get_total();
}
if (thu->not_working()) {
t += wtemplate->thu->get_total();
} else {
t += thu->get_total();
}
if (fri->not_working()) {
t += wtemplate->fri->get_total();
} else {
t += fri->get_total();
}
return t;
}
Day* Week::getMon() {
return mon;
}