Migrates AreaEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across aes service and plugin.
This commit is contained in:
102 files changed
+3307
-3313
No files matched your search
+38
-38
@@ -176,15 +176,15 @@ bool ObjectExplosionArea::removeObjectFromDb()
|
||||
|
||||
Core::FunctionReplyObject ObjectExplosionArea::resumePause(const ExplosionAreaPauseResumeRequest &req)
|
||||
{
|
||||
if (req.resumeExecution())
|
||||
if (req.resumeExecution)
|
||||
{
|
||||
if (req.timeToResume().is_set())
|
||||
m_data.effectStart = QDateTime::fromMSecsSinceEpoch(req.timeToResume().get());
|
||||
if (req.timeToResume.is_set())
|
||||
m_data.effectStart = QDateTime::fromMSecsSinceEpoch(req.timeToResume.get());
|
||||
else
|
||||
m_data.effectStart = partitionTime();
|
||||
|
||||
if (req.remainingDuration().is_set())
|
||||
m_data.effectDuration = req.remainingDuration().get();
|
||||
if (req.remainingDuration.is_set())
|
||||
m_data.effectDuration = req.remainingDuration.get();
|
||||
|
||||
// req.resumeSeed() currently not used, as it is calculated internaly. maybe in the future
|
||||
|
||||
@@ -262,38 +262,38 @@ void ObjectExplosionArea::publishAiv()
|
||||
const QRectF bounds(poly.boundingRect());
|
||||
|
||||
AesItemView aiv(m_aiv);
|
||||
aiv.aesItemId(m_data.id);
|
||||
aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId);
|
||||
aiv.effectStart(toMSec(m_data.effectStart));
|
||||
ddsVecFromPoly(poly, aiv.form());
|
||||
aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.topLeft().x(), bounds.topLeft().y())); // QRectF's bigger values are at bottom
|
||||
aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.bottomRight().x(), bounds.bottomRight().y()));
|
||||
aiv.aesTypeId(AesType::AtExplosionArea);
|
||||
aiv.effectStateId(effectState());
|
||||
aiv.id(1000 * m_data.id + AesType::AtExplosionArea);
|
||||
aiv.aesItemId = m_data.id;
|
||||
aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId;
|
||||
aiv.effectStart = toMSec(m_data.effectStart);
|
||||
ddsVecFromPoly(poly, aiv.form);
|
||||
aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.topLeft().x(), bounds.topLeft().y()); // QRectF's bigger values are at bottom
|
||||
aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.bottomRight().x(), bounds.bottomRight().y());
|
||||
aiv.aesTypeId = AesType::AtExplosionArea;
|
||||
aiv.effectStateId = effectState();
|
||||
aiv.id = 1000 * m_data.id + static_cast<int>(AesType::AtExplosionArea);
|
||||
if (m_data.partyId != 0)
|
||||
aiv.partyId(m_data.partyId);
|
||||
aiv.partyId = m_data.partyId;
|
||||
|
||||
checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral);
|
||||
checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral);
|
||||
|
||||
const QVector<QPointF> singleExplosions = Polygons::explosionAreaSingleExplosions(data());
|
||||
|
||||
AesItemView aiv2(m_aiv2);
|
||||
aiv2.aesItemId(m_data.id);
|
||||
aiv2.chargeStruct().chargeTypeId(m_data.chargeTypeId);
|
||||
aiv2.effectStart(toMSec(m_data.effectStart));
|
||||
ddsVecFromPoly(singleExplosions, aiv2.form());
|
||||
aiv2.boundingBoxBottomLeft(aiv.boundingBoxBottomLeft());
|
||||
aiv2.boundingBoxTopRight(aiv.boundingBoxTopRight());
|
||||
aiv2.aesTypeId(AesType::AtExplosionAreaSingleExplosions);
|
||||
aiv2.id(1000 * m_data.id + AesType::AtExplosionAreaSingleExplosions);
|
||||
aiv2.effectStateId(effectState());
|
||||
aiv2.aesItemId = m_data.id;
|
||||
aiv2.chargeStruct.chargeTypeId = m_data.chargeTypeId;
|
||||
aiv2.effectStart = toMSec(m_data.effectStart);
|
||||
ddsVecFromPoly(singleExplosions, aiv2.form);
|
||||
aiv2.boundingBoxBottomLeft = aiv.boundingBoxBottomLeft;
|
||||
aiv2.boundingBoxTopRight = aiv.boundingBoxTopRight;
|
||||
aiv2.aesTypeId = AesType::AtExplosionAreaSingleExplosions;
|
||||
aiv2.id = 1000 * m_data.id + static_cast<int>(AesType::AtExplosionAreaSingleExplosions);
|
||||
aiv2.effectStateId = effectState();
|
||||
if (m_data.partyId != 0)
|
||||
aiv2.partyId(m_data.partyId);
|
||||
aiv2.partyId = m_data.partyId;
|
||||
|
||||
if (aiv != m_aiv)
|
||||
{
|
||||
aiv.sampleTime(partitionTimeMSec());
|
||||
aiv.sampleTime = partitionTimeMSec();
|
||||
m_aiv = aiv;
|
||||
m_mainHandler->dds()->dts()->publish(aiv);
|
||||
emit newAiv(aiv);
|
||||
@@ -301,7 +301,7 @@ void ObjectExplosionArea::publishAiv()
|
||||
|
||||
if (aiv2 != m_aiv2)
|
||||
{
|
||||
aiv2.sampleTime(partitionTimeMSec());
|
||||
aiv2.sampleTime = partitionTimeMSec();
|
||||
m_aiv2 = aiv2;
|
||||
m_mainHandler->dds()->dts()->publish(aiv2);
|
||||
emit newAiv(aiv2);
|
||||
@@ -312,8 +312,8 @@ void ObjectExplosionArea::removeTopics()
|
||||
{
|
||||
auto dts = m_mainHandler->dds()->dts();
|
||||
dts->removeExplosionAreaByKey(m_data.id);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionArea);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionAreaSingleExplosions);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + static_cast<int>(AesType::AtExplosionArea));
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + static_cast<int>(AesType::AtExplosionAreaSingleExplosions));
|
||||
emit removeAiv(m_data.id);
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ void ObjectExplosionArea::stopSingleExplosionHandling(AesEffectState newState)
|
||||
{
|
||||
m_singleExplosionTriggerTimer->stop();
|
||||
|
||||
if (m_data.effectStateId != AesEffectState_def::EsActivated)
|
||||
if (m_data.effectStateId != AesEffectState::EsActivated)
|
||||
return;
|
||||
|
||||
// int chargeCountUntilLastStart = lrint((m_data.originalEffectDuration - m_data.effectDuration) / impactDeltaMSec());
|
||||
@@ -401,18 +401,18 @@ void ObjectExplosionArea::checkNextSingleExplosion()
|
||||
|
||||
// publish new triggered explosions data here
|
||||
TriggeredImpacts ti;
|
||||
ti.id(1000 * m_data.id + AesType::AtExplosionAreaSingleExplosions);
|
||||
ti.aesItemId(m_data.id);
|
||||
ti.aesTypeId(AesType::AtExplosionAreaSingleExplosions);
|
||||
ti.sampleTime(partitionTimeMSec());
|
||||
ti.id = 1000 * m_data.id + static_cast<int>(AesType::AtExplosionAreaSingleExplosions);
|
||||
ti.aesItemId = m_data.id;
|
||||
ti.aesTypeId = AesType::AtExplosionAreaSingleExplosions;
|
||||
ti.sampleTime = partitionTimeMSec();
|
||||
|
||||
ti.impactCount(impactCount);
|
||||
ti.bitfield().resize((impactCount + 7) / 8);
|
||||
ti.impactCount = impactCount;
|
||||
ti.bitfield.resize((impactCount + 7) / 8);
|
||||
// not very fast but ok for now
|
||||
for(int i = 0; i < impactCount; ++i)
|
||||
{
|
||||
// Triggered Impact == 0, if impact has taken place
|
||||
LtsUtils::BitArray::setBit(ti.bitfield(), i, i >= curExplosionNumber); // not "<" -> explosion NUMBER
|
||||
LtsUtils::BitArray::setBit(ti.bitfield, i, i >= curExplosionNumber); // not "<" -> explosion NUMBER
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing TriggeredExplosions with curExplosionNumber " << curExplosionNumber;
|
||||
|
||||
Reference in new issue
Block a user