Класс TheaterLights - Nero-ro/Facade GitHub Wiki
- on()
- off()
- dim()
- toString()
#ifndef THEATERLIGHTS_H
#define THEATERLIGHTS_H
#include
#include
using namespace std;
class TheaterLights
{
private:
QString description;
public:
TheaterLights(QString description); void on(); void off(); void dim(int level); QString toString();
};
#endif // THEATERLIGHTS_H
#include "theaterlights.h"
TheaterLights::TheaterLights(QString description)
{
this->description = description;
}
void TheaterLights::on() {
cout << description.toStdString() << " on" << endl;
}
void TheaterLights::off() {
cout << description.toStdString() << " off" << endl;
}
void TheaterLights::dim(int level) {
cout << description.toStdString() << " dimming to " << level << "%" << endl;
}
QString TheaterLights::toString() {
return description;
}