Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+64
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* Namespace and function for creating a Firing Strategy
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Fritsche, ESZS, 2026-05-11
|
||||
*/
|
||||
|
||||
#include "firing_strategy_factory.h"
|
||||
|
||||
#include "default_firing_strategy.h"
|
||||
#include "dm72_firing_strategy.h"
|
||||
#include "gmlrs_firing_strategy.h"
|
||||
#include "smart_firing_strategy.h"
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "object_effector.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
namespace FiringStrategyFactory
|
||||
{
|
||||
|
||||
AbstractFiringStrategy *createFiringStrategy(ObjectEffector *parent)
|
||||
{
|
||||
LOGGER_T &logger = getLogger("FiringStrategyFactory");
|
||||
|
||||
TRACE_LOG(logger) << LOGFUNCTION << " START";
|
||||
|
||||
if (!parent)
|
||||
return nullptr;
|
||||
|
||||
const ChargeStruct &cs = parent->effectorData().chargeStruct();
|
||||
|
||||
DEBUG_LOG(logger) << LOGFUNCTION << " ChargeStruct = " << cs;
|
||||
|
||||
// GMLRS
|
||||
if (parent->mainHandler()->dds()->pdmDtc()->isGmlrs(cs.chargeTypeId()))
|
||||
{
|
||||
TRACE_LOG(logger) << LOGFUNCTION << " END";
|
||||
return new GmlrsFiringStrategy(parent);
|
||||
}
|
||||
|
||||
// SMArt
|
||||
const bool bIsSmart = parent->mainHandler()->dds()->pdmDtc()->isSmart(cs.chargeTypeId(), cs.igniterTypeId(), cs.igniterFunctionId());
|
||||
if (bIsSmart)
|
||||
{
|
||||
TRACE_LOG(logger) << LOGFUNCTION << " END";
|
||||
return new SmartFiringStrategy(parent);
|
||||
}
|
||||
|
||||
// DM72
|
||||
if (parent->mainHandler()->dds()->pdmDtc()->isDm72(cs.chargeTypeId()))
|
||||
{
|
||||
TRACE_LOG(logger) << LOGFUNCTION << " END";
|
||||
return new Dm72FiringStrategy(parent);
|
||||
}
|
||||
|
||||
TRACE_LOG(logger) << LOGFUNCTION << " END";
|
||||
return new DefaultFiringStrategy(parent);
|
||||
}
|
||||
|
||||
} //namespace FiringFactory
|
||||
} //namespace AreaEffectSimulation
|
||||
Reference in new issue
Block a user