SWADP/Opdracht_4/inc/MachineImpl.cpp
Shaquille Soekhlal 7723e68186 Opdracht 4 code en design
Co-authored-by: Aryan Lala (19097727) <A.E.Lala@student.hhs.nl>
2023-06-11 16:15:15 +02:00

28 lines
470 B
C++

#include "MachineImpl.h"
#include "DieselMotor.h"
#include "ElectrischeMotor.h"
#include "TsensorImpl.h"
MachineImpl::MachineImpl(Motor* m1, Motor* m2): m1(m1), m2(m2){};
void MachineImpl::run(){
t1 = m1->tsensor();
t1->read();
m1->start();
t2 = m2->tsensor();
t2->read();
m2->start();
}
void MachineImpl::halt(){
m1->stop();
m2->stop();
}
Motor* MachineImpl::motor1(){
return m1;
}
Motor* MachineImpl::motor2(){
return m2;
}