consolidate all repos to one for archive
This commit is contained in:
23
semester_2/programiranje_2/Prirava_2/Message.h
Normal file
23
semester_2/programiranje_2/Prirava_2/Message.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// 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
|
22
semester_2/programiranje_2/Prirava_2/Player.h
Normal file
22
semester_2/programiranje_2/Prirava_2/Player.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Created by Nik on 09/06/2022.
|
||||
//
|
||||
|
||||
#ifndef PRIRAVA_2_PLAYER_H
|
||||
#define PRIRAVA_2_PLAYER_H
|
||||
|
||||
#include <string>
|
||||
|
||||
class Player {
|
||||
private:
|
||||
std::string name;
|
||||
int number;
|
||||
public:
|
||||
Player(std::string name, int number) : name(name), number(number){} ;
|
||||
std::string toString(){
|
||||
return "Player: " + name + " " + std::to_string(number) + "\n";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif //PRIRAVA_2_PLAYER_H
|
6
semester_2/programiranje_2/Prirava_2/main.cpp
Normal file
6
semester_2/programiranje_2/Prirava_2/main.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello, World!" << std::endl;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user