/** * Handler for player data * $Id$ * $HeadURL$ * $Author$ * Created by gr, SLSE, 2017-02-20 */ #pragma once #include #include #include #include #include #include #include // AES-Handling for participants namespace CentralEffectSimulationBasic { class HandlerParticipantBorderline final : public QObject { Q_OBJECT struct BorderlineUtm { int id = 0; int zone = -1; int32_t operatorId = 0; int32_t partyId = -1; QPolygonF points; QRectF boundingBox; QString name; BorderlineUtm() = default; explicit BorderlineUtm(const AreaEffectSimulation::Borderline &bl); }; public: HandlerParticipantBorderline(const std::shared_ptr &ddsHandler, const std::shared_ptr &participantHandler, QObject *parent = nullptr); ~HandlerParticipantBorderline(); /** * Initialize the handler to manage information from player management */ bool init(); private Q_SLOTS: /** * Handle the signals from 'ParticipantHandler' */ void onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos); /** * Handle the signals from 'AES' */ void onBorderlineChanged(const AreaEffectSimulation::Borderline &data, DataModification modType); private: // methoden void sendParticipantEvent(const BorderlineUtm &borderline, const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition, const ProjectDataManagement::EventType eventType); bool intersect(const QPolygonF &polygonf, const QLineF &linef) const; private: // attributes std::shared_ptr m_ddsHandler; ///< Pointer to VOM DDS handler std::shared_ptr m_handlerParticipant; // AES-Values QHash m_borderlines; // key = aesItemId CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility }; } // namespace CentralEffectSimulationBasic