71 lines
2.1 KiB
C++
Executable File
71 lines
2.1 KiB
C++
Executable File
/**
|
|
* Handler for Blocked Areas
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by gr, SLSE, 2018-07-02
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <CentralEffectSimulation/logger.h>
|
|
|
|
#include <CentralEffectSimulation/dds_handler.h>
|
|
#include <CentralEffectSimulation/ces_db.h>
|
|
#include <ParticipantManagement/ppm_dtc.h>
|
|
#include <TrainingAreaBase/tab_ftc.h>
|
|
#include <CentralEffectSimulation/handler_participant.h>
|
|
#include <handler_participant_building.h>
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
// AES-Handling for participants within buildings
|
|
|
|
namespace CesParticipantBuildings
|
|
{
|
|
|
|
class HandlerBlockedAreas final
|
|
: public QObject
|
|
, protected TrainingAreaBase::Interface::Ftc::SendParticipantBlockedAreaReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
|
|
explicit HandlerBlockedAreas(const std::shared_ptr<CentralEffectSimulation::DdsHandler> &ddsHandler,
|
|
const std::shared_ptr<CentralEffectSimulation::HandlerParticipant> &participantHandler,
|
|
const std::shared_ptr<HandlerParticipantBuilding> &participantBuildingHandler,
|
|
QObject *parent);
|
|
|
|
~HandlerBlockedAreas();
|
|
|
|
/**
|
|
* Initialize the handler to manage information from player management
|
|
*/
|
|
bool init();
|
|
|
|
protected:
|
|
void onSendParticipantBlockedAreaReply(const Core::FunctionReplyObject &replyObject) override final;
|
|
|
|
private Q_SLOTS:
|
|
|
|
/**
|
|
* Handle new Participant Position
|
|
*/
|
|
void onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos);
|
|
void onBuildingStateChanged(const int32_t buildingId);
|
|
|
|
|
|
private: // attributes
|
|
std::shared_ptr<CentralEffectSimulation::DdsHandler> m_ddsHandler; ///< Pointer to DDS handler
|
|
|
|
std::shared_ptr<CentralEffectSimulation::HandlerParticipant> m_handlerParticipant;
|
|
std::shared_ptr<HandlerParticipantBuilding> m_handlerParticipantBuilding;
|
|
|
|
QHash <int, int> m_blockedAreas; // key = participantId, value = roomId
|
|
|
|
CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility
|
|
|
|
};
|
|
} // namespace CesParticipantBuildings
|
|
|