#ifndef BLOCKSTORE_H #define BLOCKSTORE_H #include #include #include #include "block.h" #include "overlorditemstore.h" #include "blockborder.h" #include "microcontroller.h" #include "itemstore.h" class Layout : public QObject { Q_OBJECT private: private: std::vector> blocks_; std::vector> borders_; std::vector>> limbo_; void removeTagFromAllBlocks(const NfcUid& tag); void registerTagInLimbo(const NfcUid& tag, std::shared_ptr); OverlordItemStore *items_; public: explicit Layout(OverlordItemStore *items, QObject *parent = nullptr); void addBlock(std::shared_ptr block); void addBorder(std::shared_ptr border); void store(QJsonObject& json); void load(const QJsonObject& json); std::shared_ptr getBorder(uint32_t id); std::shared_ptr getBlock(uint32_t id); public slots: void tagArrivedAtReader(uint8_t reader, NfcUid tag); }; #endif // BLOCKSTORE_H