/** * Handler for player data * $Id$ * $HeadURL$ * $Author$ * Created by gr, SLSE, 2017-02-20 */ #pragma once #include #include #include #include #include #include #include #include #include #include // AES-Handling for participants namespace CentralEffectSimulationGasPipes { class HandlerParticipantGasPipe final : public QObject , protected TrainingAreaBase::Interface::Ftc::SendCesHitReplyHandler { Q_OBJECT public: HandlerParticipantGasPipe(const std::shared_ptr &ddsHandler, const std::shared_ptr &participantHandler, QObject *parent = nullptr); ~HandlerParticipantGasPipe(); /** * Initialize the handler to manage information from player management */ bool init(); protected: void onSendCesHitReply(const Core::FunctionReplyObject &replyObject) override final; private Q_SLOTS: /** * Handle the signals from 'ParticipantHandler' */ void onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos); /** * Handle the signals from 'AES' */ void onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType); void onGasPipeChanged(const AreaEffectSimulation::GasPipe &data, DataModification modType); /** * Send Hit to participant */ void sendFtcCesHitRequestTimeout(); private: // methoden void sendParticipantEvent(const CentralEffectSimulation::AesItemViewUtm &gasPipe, const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition, const ProjectDataManagement::EventType eventType); void sendParticipantHit(const CentralEffectSimulation::AesItemViewUtm &gasPipe, const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition, const ProjectDataManagement::EventType eventType); bool insideGasPipeArea(const QPolygonF &polygonf, const QPointF &participantPos) const; void calculateGasPipeParticipant(const CentralEffectSimulation::AesItemViewUtm &gasPipe, const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition); private: // attributes std::shared_ptr m_ddsHandler; ///< Pointer to VOM DDS handler std::shared_ptr m_handlerParticipant; // std::shared_ptr m_handlerAesData; // AES-Values QHash m_gasPipes; // key = aesItemId QHash m_requestMap; // Key = equipmentNumber QTimer *m_timer; CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility}; }; } // namespace CentralEffectSimulationGasPipes