Exemplo n.º 1
0
        //============================================================================*
        // VerifyLoad()
        //============================================================================*

        public bool VerifyLoad(cLoad Load, cFirearm.eFireArmType eFirearmType, cCaliber Caliber, cBullet Bullet, cPowder Powder)
        {
            if (Load == null)
            {
                return(false);
            }

            //----------------------------------------------------------------------------*
            // See if we need to show this load regardless of other considerations
            //----------------------------------------------------------------------------*

            if (m_fShowBatchLoad && m_Batch.Load.CompareTo(Load) == 0)
            {
                return(true);
            }

            //----------------------------------------------------------------------------*
            // Check Filters
            //----------------------------------------------------------------------------*

            if ((eFirearmType != cFirearm.eFireArmType.None && Load.FirearmType != eFirearmType) ||
                (Caliber != null && Load.Caliber.CompareTo(Caliber) != 0) ||
                (Bullet != null && Load.Bullet.CompareTo(Bullet) != 0) ||
                (Powder != null && Load.Powder.CompareTo(Powder) != 0))
            {
                return(false);
            }

            //----------------------------------------------------------------------------*
            // Check Inventory
            //----------------------------------------------------------------------------*

            if (!m_DataFiles.VerifyLoadQuantities(m_Batch, Load))
            {
                return(false);
            }

            //----------------------------------------------------------------------------*
            // Make sure the caliber is not hidden
            //----------------------------------------------------------------------------*

            if (m_DataFiles.Preferences.HideUncheckedCalibers && !Load.Caliber.Checked)
            {
                return(false);
            }

            //----------------------------------------------------------------------------*
            // Make sure the supplies are not hidden
            //----------------------------------------------------------------------------*

            if (m_DataFiles.Preferences.HideUncheckedSupplies)
            {
                if (!Load.Bullet.Checked || !Load.Powder.Checked || !Load.Primer.Checked || !Load.Case.Checked)
                {
                    return(false);
                }
            }

            return(true);
        }