1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#ifndef ENTERTAINMENT_H
#define ENTERTAINMENT_H
#include "film.h"
#include <QString>
class Entertainment : public Film
{
public:
enum m_FilmType{Action, Comedy, Sci_Fi, Horror, Drama, Romance};
enum MPAARatings{G, PG, PG_13, NSV16, NSV18};
Entertainment(QString f_ID, QString f_Title,
QString f_Director, int f_Length, QDate ReleaseDate, m_FilmType Type, MPAARatings Rating);
QString toString();
private:
m_FilmType m_Type;
MPAARatings m_Rating;
};
#endif // ENTERTAINMENT_H
#include "entertainment.h"
Entertainment::Entertainment(QString f_ID, QString f_Title,
QString f_Director, int f_Length, QDate ReleaseDate,
m_FilmType Type, MPAARatings Rating):Film(f_ID, f_Title, f_Director, f_Length, ReleaseDate)
{
m_Type = Type;
m_Rating = Rating;
}
QString Entertainment::toString()
{
QSatring tempStr;
QTextStream actualStr(&tempStr);
actualStr <<Film::toString()<< " Movie Type: "<<m_Type<<" MPAARating: "<<m_Rating<<endl;
return tempStr;
}
|