24 lines
466 B
C++
24 lines
466 B
C++
//
|
|
// Created by Nik on 09/06/2022.
|
|
//
|
|
|
|
#ifndef PRIRAVA_2_MESSAGE_H
|
|
#define PRIRAVA_2_MESSAGE_H
|
|
|
|
#include <string>
|
|
|
|
class Message{
|
|
protected:
|
|
int time;
|
|
std::string text;
|
|
public:
|
|
Message(int time, std::string text): text(text) {
|
|
if (time < 1 or time > 90) throw WrongTimeException();
|
|
};
|
|
virtual std::string toString() const{
|
|
return std::to_string(time) + text + "\n";
|
|
};
|
|
};
|
|
|
|
#endif //PRIRAVA_2_MESSAGE_H
|