//============================================================================* // cFactoryAmmoTestList() - Copy Constructor //============================================================================* public cAmmoTestList(cAmmoTestList FactoryAmmoTestList) { if (FactoryAmmoTestList == null) { return; } foreach (cAmmoTest FactoryAmmoTest in FactoryAmmoTestList) { Add(new cAmmoTest(FactoryAmmoTest)); } }
//============================================================================* // Copy() //============================================================================* public void Copy(cAmmo Ammo, bool fCopyBase = true) { if (fCopyBase) { base.Copy(Ammo); } m_strPartNumber = Ammo.m_strPartNumber; m_strType = Ammo.m_strType; m_nBatchID = Ammo.m_nBatchID; m_fReload = Ammo.m_fReload; m_Caliber = Ammo.m_Caliber; m_dBallisticCoefficient = Ammo.m_dBallisticCoefficient; m_dBulletDiameter = Ammo.m_dBulletDiameter; m_dBulletWeight = Ammo.m_dBulletWeight; m_TestList = new cAmmoTestList(Ammo.m_TestList); }
//============================================================================* // Append() //============================================================================* public bool Append(cAmmoTestList AmmoTestList, bool fCountOnly = false) { foreach (cAmmoTest CheckAmmoTest in AmmoTestList) { bool fFound = false; foreach (cAmmoTest AmmoTest in this) { if (CheckAmmoTest.CompareTo(AmmoTest) == 0) { AmmoTest.Append(CheckAmmoTest, fCountOnly); fFound = true; } } if (!fFound && !fCountOnly) { Add(CheckAmmoTest); } } return(true); }