Files
qt5-legatus-legacy/Lts/Services/CentralEffectSimulation/Plugins/Explosions/handler_vulcano.h
T
2026-08-13 18:33:10 +02:00

87 lines
2.6 KiB
C++
Executable File

/**
* Handler for player data
* $Id$
* $HeadURL$
* $Author$
* Created by gr, SLSE, 2017-02-20
*/
#pragma once
#include <CentralEffectSimulation/logger.h>
#include <CentralEffectSimulation/dds_handler.h>
#include <CentralEffectSimulation/aes_item_view_utm.h>
#include <CentralEffectSimulation/handler_participant.h>
#include <AreaEffectSimulation/aes_dtc.h>
#include <AreaEffectSimulation/aes_ftc.h>
#include <ProjectDataManagement/pdm_dtc.h>
#include <QtCore/QObject>
#include <QtCore/QMap>
#include <QtCore/QHash>
#include <QtCore/QVector>
#include <QPolygonF>
#include <QQueue>
#include <QHash>
#include <QTimer>
namespace LtsUtils
{
class QPoint3D;
}
// AES-Handling for Explosions
namespace CesExplosions
{
//------------------------------------------------------------------------------
// class HandlerVulcano
//------------------------------------------------------------------------------
class HandlerVulcano : public QObject
, protected AreaEffectSimulation::Interface::Ftc::TargetPositionsModifyReplyHandler
{
Q_OBJECT
public:
typedef QHash<int, QSet<int>> BitfieldStates;
explicit HandlerVulcano(const std::shared_ptr<CentralEffectSimulation::DdsHandler> &ddsHandler,
QObject *parent = nullptr);
~HandlerVulcano();
/**
* Initialize the handler to manage information from player management
*/
bool init();
protected:
void onTargetPositionsModifyReply(const Core::FunctionReplyObject &replyObject) override final;
private slots:
void onExplosionClusterChanged(const AreaEffectSimulation::ExplosionCluster &data, DataModification modType);
void onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType);
void onFiringTimeTimeout();
void onTrajectoryTimeAwareTimeout();
private: // functions
// firstTrajectoryTimeAwareFromAesId and getTrajectoryPosFromTime were initially created as AesDtcCustomFunction.
// But since they are very specific, they were moved to this place:
AreaEffectSimulation::TrajectoryTimeAware firstTrajectoryTimeAwareFromAesId(int aesId);
Core::GeoPosition getTrajectoryPosFromTime(int aesId, long long timeParam);
private: // attributes
std::shared_ptr<CentralEffectSimulation::DdsHandler> m_ddsHandler; ///< Pointer to VOM DDS handler
// AES-Values
QHash<int, AreaEffectSimulation::ExplosionCluster> m_explosionCluster; // key = AesId
QHash<int, QTimer *> m_aesTimers; // key = aesId value= VulcanoTimer
CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility
};
} // namespace CesExplosions