//============================================================================* // ProcessBatches() //============================================================================* public void ProcessBatches() { m_nNumBadBatches = 0; m_nNumBatchTests = 0; m_nNumBadBatchTests = 0; foreach (cBatch Batch in m_DataFiles.BatchList) { if (!Batch.Validate()) { m_nNumBadBatches++; } if (Batch.BatchTest != null) { m_nNumBatchTests++; if (!Batch.BatchTest.Validate()) { m_nNumBadBatchTests++; } m_nNumTestShots += Batch.BatchTest.TestShotList.Count; foreach (cTestShot TestShot in Batch.BatchTest.TestShotList) { if (!TestShot.Validate()) { m_nNumBadTestShots++; } } } } }
//============================================================================* // Export() - XML //============================================================================* public void Export(cRWXMLDocument XMLDocument, XmlElement XMLParentElement) { if (Count > 0) { XmlElement XMLElement = XMLDocument.CreateElement(ExportName); XMLParentElement.AppendChild(XMLElement); foreach (cTestShot TestShot in this) { TestShot.Export(XMLDocument, XMLElement); } } }
//============================================================================* // ProcessAmmo() //============================================================================* public void ProcessAmmo() { m_nNumBadAmmo = 0; m_nNumAmmoTests = 0; m_nNumBadAmmoTests = 0; foreach (cAmmo Ammo in m_DataFiles.AmmoList) { if (!Ammo.Validate()) { m_nNumBadAmmo++; } ProcessTransactionList(Ammo); m_nNumAmmoTests += Ammo.TestList.Count(); bool fFirearmFound = false; foreach (cAmmoTest AmmoTest in Ammo.TestList) { if (!AmmoTest.Validate()) { m_nNumBadAmmoTests++; } if (Ammo.CompareTo(AmmoTest.Ammo) != 0) { m_nNumBadAmmoTests++; } if (AmmoTest.Firearm != null) { foreach (cFirearm firearm in m_DataFiles.FirearmList) { if (firearm.CompareTo(AmmoTest.Firearm) == 0) { fFirearmFound = true; break; } } if (!fFirearmFound) { m_nNumBadAmmoTests++; } } m_nNumTestShots += AmmoTest.TestShotList.Count; foreach (cTestShot TestShot in AmmoTest.TestShotList) { if (!TestShot.Validate()) { m_nNumBadTestShots++; } } } } }