2024-08-19 02:35:16 +03:00
|
|
|
#include "check.h"
|
|
|
|
#include "../goods/goods.h"
|
|
|
|
|
|
|
|
Check::Check() {}
|
2024-08-24 00:45:47 +03:00
|
|
|
|
2024-08-19 02:35:16 +03:00
|
|
|
void Check::add_goods(Goods goods) { this->goods.push_back(goods); }
|
2024-08-24 00:45:47 +03:00
|
|
|
|
2024-08-19 02:35:16 +03:00
|
|
|
double Check::calculae_total_price() {
|
|
|
|
double total = 0.0;
|
|
|
|
|
|
|
|
for (Goods g : this->goods) {
|
|
|
|
total += g.calculate_total_price();
|
|
|
|
}
|
|
|
|
|
|
|
|
return total;
|
|
|
|
}
|
2024-08-24 00:45:47 +03:00
|
|
|
|
|
|
|
std::vector<Goods>& Check::get_goods() {
|
|
|
|
return goods;
|
|
|
|
}
|