consolidate all repos to one for archive
This commit is contained in:
20
semester_2/programiranje_2/naloga0502/SmartHome.cpp
Normal file
20
semester_2/programiranje_2/naloga0502/SmartHome.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "SmartHome.h"
|
||||
|
||||
SmartHome::SmartHome(std::string name) : name(name){}
|
||||
|
||||
SmartHome::~SmartHome(){
|
||||
for (Device* device: devices) {
|
||||
delete device;
|
||||
}
|
||||
}
|
||||
|
||||
std::string SmartHome::toString() const {
|
||||
std::string str;
|
||||
str = "House name: " + name + "\n";
|
||||
for (auto device : devices) str += device->toString();
|
||||
return str;
|
||||
}
|
||||
|
||||
void SmartHome::addDevice(Device *device) {
|
||||
devices.push_back(device);
|
||||
}
|
||||
Reference in New Issue
Block a user