56 lines
1.7 KiB
C++

#include "Literature.h"
Literature::Literature(std::string title, std::string description, int price, int year, std::shared_ptr<Artist> artist, double width, double height, double depth, LiteratureType material) :
Artwork(title, description, price, year, artist, width, height, depth), material(material)
{}
std::string Literature::getMaterial() const
{
switch (material)
{
case LiteratureType::Drama:
return "Drama";
break;
case LiteratureType::Biography:
return "Biography";
break;
case LiteratureType::Poetry:
return "Poetry";
break;
case LiteratureType::Prose:
return "Prose";
break;
case LiteratureType::ScienceFiction:
return "Science fiction";
break;
default:
return "?";
}
}
std::string Literature::toString() const
{
return "Title: " + title +
"\nDescription: " + description +
"\nPrice: " + std::to_string(price) +
" EUR\nYear: " + std::to_string(year) +
"\nArtist: " + artist->toString() +
"\nDimension: " + dimension.toString() +
"\nLiterature type: " + getMaterial() + "\n\n";
}
void Literature::print() const
{
std::cout <<
"Title: " << title <<
"\nDescription: " << description <<
"\nPrice: " << std::to_string(price) <<
" EUR\nYear: " << std::to_string(year) <<
"\nArtist: " << artist->toString() <<
"\nDimension: " << dimension.toString() <<
"\nLiterature type: " << getMaterial() << "\n\n";
}
Literature::Literature()
{}