move build system to cmake, add train overlord
This commit is contained in:
parent
ddd0b3a732
commit
a1f9fa172b
60 changed files with 338 additions and 997 deletions
26
src/trainOverlord/overlorditemstore.cpp
Normal file
26
src/trainOverlord/overlorditemstore.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include "overlorditemstore.h"
|
||||
#include <QDebug>
|
||||
#include "train.h"
|
||||
|
||||
OverlordItemStore::OverlordItemStore(QObject *parent): ItemStore(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void OverlordItemStore::gotNfcTag(NfcUid uid)
|
||||
{
|
||||
for(std::shared_ptr<Item> item : items_)
|
||||
{
|
||||
Train* train = dynamic_cast<Train*>(item.get());
|
||||
if(!train)
|
||||
continue;
|
||||
for(const NfcUid& trainUid : train->tags)
|
||||
{
|
||||
if(trainUid == uid)
|
||||
{
|
||||
if(train->passedReader(uid))
|
||||
train->setValue(0-train->getValue());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue