#include "Literature.h" Literature::Literature(std::string title, std::string description, int price, int year, 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() + "\nPainting technique: " + 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"; }