2022-03-29 16:38:53 +00:00
|
|
|
#include "herkenningsslot.h"
|
2022-04-06 17:17:51 +00:00
|
|
|
#include <map>
|
2022-03-29 16:38:53 +00:00
|
|
|
|
2022-04-06 17:17:51 +00:00
|
|
|
HerkenningsSlot::HerkenningsSlot(Afdrukker* a): kaartenbak(),afdrukker(a){
|
2022-03-29 16:38:53 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void HerkenningsSlot::voegAutorisatieToe(string naam, bool access){
|
2022-04-06 16:01:47 +00:00
|
|
|
if (!kaartenbak.count(naam)){
|
|
|
|
kaartenbak[naam] = access;
|
|
|
|
}
|
2022-03-29 16:38:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void HerkenningsSlot::ontgrendel(string naam){
|
|
|
|
if (kaartenbak.count(naam) && kaartenbak[naam]){
|
|
|
|
vergrendeld = false;
|
|
|
|
}
|
|
|
|
else vergrendeld = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool HerkenningsSlot::isVergrendeld(){
|
|
|
|
return vergrendeld;
|
|
|
|
}
|
|
|
|
|
|
|
|
void HerkenningsSlot::vergrendel(){
|
|
|
|
vergrendeld = true;
|
|
|
|
}
|
|
|
|
|
2022-04-06 16:01:47 +00:00
|
|
|
void HerkenningsSlot::toonKaartenBak(){
|
2022-04-06 17:17:51 +00:00
|
|
|
afdrukker->clearMedium();
|
|
|
|
for (auto &j:kaartenbak){
|
2022-04-06 19:49:19 +00:00
|
|
|
afdrukker->toonText(j.first + " " + std::to_string(j.second));
|
2022-04-06 17:17:51 +00:00
|
|
|
}
|
2022-03-29 16:38:53 +00:00
|
|
|
}
|