-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComputer.cpp
More file actions
32 lines (27 loc) · 1.18 KB
/
Copy pathComputer.cpp
File metadata and controls
32 lines (27 loc) · 1.18 KB
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
#include "Computer.h"
Location::Location(){}
Location::Location(int hor,int ver):horizontal_row(hor),vertical_column(ver){}
Location::Location(const Location &other){
this->vertical_column=other.get_ver();
this->horizontal_row=other.get_hor();
}
int Location::get_hor()const{return horizontal_row;}
int Location::get_ver()const{return vertical_column;}
Computer::Computer(){};
Computer::Computer(std::string& id,int& hor,int& ver,Computer_type& types,std::list<UsageRecord> &usagerecords):pcid(id),location(hor,ver),type(types),usagerecord(usagerecords){}
Computer::Computer(const Computer &other){
if(this!=&other){
this->location=other.getLocation();
this->pcid=other.getPcid();
this->type=other.getComputerType();
this->usagerecord=other.getUsagerecord();
}
}
std::string Computer::getPcid()const{return pcid;}
Computer_type Computer::getComputerType()const{return type;}
std::list<UsageRecord> Computer::getUsagerecord()const{return usagerecord;}
Location Computer::getLocation()const{return location;}
std::list<UsageRecord>& Computer::getUsagerecords(){return this->usagerecord;}
void Computer::settype(Computer_type type){
this->type=type;
}