consolidate all repos to one for archive
This commit is contained in:
31
semester_2/programiranje_2/naloga1001/Painting.cpp
Normal file
31
semester_2/programiranje_2/naloga1001/Painting.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "Painting.h"
|
||||
|
||||
Painting::Painting(std::string title, std::string description, int price, int year, Artist *artist, double width, double height, double depth, PaintingTechnique technique) :
|
||||
Artwork(title, description, price, year, artist, width, height, depth), technique(technique) {}
|
||||
|
||||
std::string Painting::getTechnique() const{
|
||||
switch (technique) {
|
||||
case PaintingTechnique::Oil:
|
||||
return "Oil";
|
||||
break;
|
||||
case PaintingTechnique::Acrylic:
|
||||
return "Acrylic";
|
||||
break;
|
||||
case PaintingTechnique::Graphite:
|
||||
return "Graphite";
|
||||
break;
|
||||
default:
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
|
||||
std::string Painting::toString() const {
|
||||
return "Title: " + title +
|
||||
"\nDescription: " + description +
|
||||
"\nPrice: " + std::to_string(price) +
|
||||
" EUR\nYear: " + std::to_string(year) +
|
||||
"\nArtist: " + artist->toString() +
|
||||
"\nDimension: " + dimension.toString() +
|
||||
"\nPainting technique: " + getTechnique() + "\n\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user