59 lines
1.7 KiB
C++
Executable File
59 lines
1.7 KiB
C++
Executable File
/**
|
|
* Exercise object
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
#pragma once
|
|
|
|
#include "aes_db.h"
|
|
#include "object_base.h"
|
|
|
|
namespace AreaEffectSimulation
|
|
{
|
|
class ObjectExplosionArea final : public ObjectBaseTmpl<Database::AesExplosionArea>
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ObjectExplosionArea(MainHandler *mainHandler,
|
|
QObject *parent = nullptr);
|
|
~ObjectExplosionArea();
|
|
|
|
Core::FunctionReplyObject createObject(const Database::AesExplosionArea &data);
|
|
Core::FunctionReplyObject updateObject(const Database::AesExplosionArea &data) override;
|
|
Core::FunctionReplyObject removeObject() override;
|
|
/*!
|
|
* \brief removeObjectFromDb
|
|
* \details Removes the object from db, Used if the object is created but there are too much objects (amount border)
|
|
* \author Niklas Schmidt
|
|
* \return bool if the deletion was working
|
|
*/
|
|
bool removeObjectFromDb();
|
|
Core::FunctionReplyObject resumePause(const ExplosionAreaPauseResumeRequest &req);
|
|
|
|
std::vector<Core::GeoPosition> form() const override { return m_aiv.form(); }
|
|
QPolygonF generateForm() override;
|
|
AesType aesType() const override { return AesType::AtExplosionArea; }
|
|
bool isCentral() const override { return m_data.isCentral; }
|
|
void removeTopics();
|
|
|
|
protected:
|
|
void setEffectState(AesEffectState newState) override;
|
|
void publishAiv();
|
|
protected Q_SLOTS:
|
|
void onPublishData() override;
|
|
void checkNextSingleExplosion();
|
|
private:
|
|
void startSingleExplosionHandling();
|
|
void stopSingleExplosionHandling(AesEffectState newState);
|
|
qint64 impactDeltaMSec() const;
|
|
int currentExplosionNumber() const;
|
|
private:
|
|
QTimer *m_singleExplosionTriggerTimer;
|
|
int m_lastSentTriggeredExplosionNumber;
|
|
int m_chargeCountUntilLastStart;
|
|
AesItemView m_aiv;
|
|
AesItemView m_aiv2;
|
|
};
|
|
}
|