Qt-Gebouw/codeslot.cpp

29 lines
507 B
C++
Raw Permalink Normal View History

2022-03-29 16:38:53 +00:00
#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;
}