Add support of leaves
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user