Untitled
unknown
java
a year ago
3.3 kB
11
Indexable
/**
* @param platformName
* The platform name
* @param weapon
* The weapon-ammo name
* @return The firer
*/
private String findFirer(final String platformName, final String weapon)
{
// copied and modified from gov.ace.web.service.TRACRDBServiceImpl.findFirer(String, Long)
// FIFTY_CAL_M2HB_PK, TOW_PK, MK19_40MM_PK, M240_PK, M240_BL_PK
// are the best guess for the weapon ammo name based on doctrine files.
LOGGER.info("Looking for firer type from platform name {}", platformName);
String rtnFirer = DEFAULT_FIRER;
if (platformName.contains(M1_KEYWORD))
{
if (weapon.contains(M240_PK) || weapon.contains(M240_BL_PK))
{
rtnFirer = PINTLE_CWS_LOADER;
}
else if (weapon.contains(FIFTY_CAL_M2HB_PK))
{
rtnFirer = RWS_CROWS_SCWS;
}
else
{
rtnFirer = ABRAMS_KEYWORD;
}
}
else if (platformName.contains(M2_KEYWORD) || platformName.contains(M3_KEYWORD))
{
rtnFirer = weapon.contains(TOW_PK) ? ATGM_TOW_KEYWORD : BRADLEY_KEYWORD;
}
else if (platformName.contains(MGS_KEYWORD))
{
rtnFirer = weapon.contains(FIFTY_CAL_M2HB_PK) ? PINTLE_CWS_LOADER : MGS_KEYWORD;
}
else if (platformName.contains(M1134_ATGMV))
{
if (weapon.contains(MK19_40MM_PK))
{
rtnFirer = PINTLE_MK19_KEYWORD;
}
else if (weapon.contains(TOW_PK))
{
rtnFirer = ATGM_TOW_KEYWORD;
}
else
{
rtnFirer = PINTLE_CWS_LOADER;
}
}
else if (platformName.contains(HMMWV_KEYWORD))
{
if (weapon.contains(MK19_40MM_PK))
{
// HMMWV could be under ATGM or MMG and with this weapon system it could fall under
// PINTLE/CWS/LDR or MK19 (Pintle) or MK19 (RWS) -- Defaulting to PINTLE (MK19)
rtnFirer = PINTLE_MK19_KEYWORD;
}
else if (weapon.contains(M240_BL_PK) || weapon.contains(FIFTY_CAL_M2HB_PK))
{
// HMMWV could be under ATGM or MMG and with this weapon system it could fall under
// PINTLE/CWS/LDR or RWS/CROWS/SCWS -- Defaulting to PINTLE/CWS/LDR
rtnFirer = PINTLE_CWS_LOADER;
}
else if (weapon.contains(TOW_PK))
{
rtnFirer = ATGM_TOW_KEYWORD;
}
}
else if (platformName.contains(M1117_ASV) || platformName.contains(AAVP7A1)
|| platformName.contains(M1126_ICV))
{
if (weapon.contains(M240_BL_PK) || weapon.contains(FIFTY_CAL_M2HB_PK))
{
// MMG with these weapon systems could fall under PINTLE/CWS/LDR or RWS/CROWS/SCWS -- Defaulting to
// RWS/CROWS/SCWS
rtnFirer = RWS_CROWS_SCWS;
}
else if (weapon.contains(MK19_40MM_PK))
{
// MMG with this weapon system could fall under PINTLE(MK19) or RWS(MK19) -- Defaulting to
// PINTLE(MK19)
rtnFirer = PINTLE_MK19_KEYWORD;
}
}
LOGGER.info("Returning firer of {} for platform {} and weapon {}", rtnFirer, platformName, weapon);
return rtnFirer;
}
Editor is loading...
Leave a Comment