Qt-Gebouw/codeslot.cpp
2022-03-29 18:38:53 +02:00

29 lines
507 B
C++

#include "codeslot.h"
#include <stdexcept>
#include <iostream>
CodeSlot::CodeSlot(int code): vergrendeld(true), code(code){
}
bool CodeSlot::isVergrendeld(){
return vergrendeld;
}
void CodeSlot::ontgrendel(string code){
try{
if (stoi(code) == this->code){
vergrendeld = false;
}
else{
vergrendeld = true;
}
}
catch(const std::invalid_argument &error){
return;
}
}
void CodeSlot::vergrendel(){
vergrendeld = true;
}