24 lines
406 B
C++

//
// Created by Nik on 10/04/2022.
//
#include "Canvas.h"
void Canvas::addShape(Shape2D *s) {
shapes.push_back(s);
}
void Canvas::print() const {
for (auto shape: shapes) {
shape->draw();
}
}
unsigned int Canvas::getTotalArea() const {
unsigned int res = 0;
for (auto shape: shapes) {
res += shape->getSurfaceArea();
}
return res;
}