Exemplo n.º 1
0
 protected override void Awake()
 {
     base.Awake();
     ammoType = FirearmType.NULL;
     onSelectExit.AddListener(OnDeselect);
     onSelectEnter.AddListener(RegisterInteractor);
 }
 private void FirearmTypeUpdate_Click(object sender, RoutedEventArgs e)
 {
     if (ListBoxFirearmType.SelectedItem != null && TextBoxTypeName.Text != "")
     {
         FirearmType currentType = ListBoxFirearmType.SelectedItem as FirearmType;
         _update.UpdateFirearmType(currentType.FirearmTypeID, TextBoxTypeName.Text);
         PopulateControls();
     }
 }
 private void FirearmTypeDelete_Click(object sender, RoutedEventArgs e)
 {
     if (ListBoxFirearmType.SelectedItem != null)
     {
         FirearmType currentType = ListBoxFirearmType.SelectedItem as FirearmType;
         _delete.DeleteFirearmType(currentType.FirearmTypeID);
         PopulateControls();
     }
 }
        private void ListBoxFirearmType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ListBoxFirearmType.SelectedItem != null)
            {
                FirearmType currentType = ListBoxFirearmType.SelectedItem as FirearmType;

                TextBoxTypeName.Text = currentType.TypeName;
            }
        }
 private void FirearmCreate_Click(object sender, RoutedEventArgs e)
 {
     if (TextBoxFirearmName.Text != "" && TextBoxMuzzleVelocity.Text != "" && ComboBoxAmmunition.SelectedItem != null && ComboBoxFirearmType.SelectedItem != null)
     {
         FirearmType currentFirearmType = ComboBoxFirearmType.SelectedItem as FirearmType;
         Ammunition  currentAmmunition  = ComboBoxAmmunition.SelectedItem as Ammunition;
         _create.AddFirearm(TextBoxFirearmName.Text, Int32.Parse(TextBoxMuzzleVelocity.Text), currentFirearmType.FirearmTypeID, currentAmmunition.AmmunitionID);
         PopulateControls();
     }
 }
Exemplo n.º 6
0
    public void AddAmmo(FirearmType a_ammoType, int a_amount)
    {
        if (ammoCountDictionary.ContainsKey(a_ammoType))
        {
            ammoCountDictionary[a_ammoType] += a_amount;
        }
        else
        {
            ammoCountDictionary.Add(a_ammoType, a_amount);
        }

        UpdateAmmoCounter();
    }
Exemplo n.º 7
0
        //============================================================================*
        // CompareTo()
        //============================================================================*

        public int CompareTo(Object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            cCaliber Caliber = (cCaliber)obj;

            cCaliber.CurrentFirearmType = FirearmType;

            int rc = FirearmType.CompareTo(Caliber.FirearmType);

            if (rc == 0)
            {
                rc = Name.ToUpper().CompareTo(Caliber.Name.ToUpper());
            }

            return(rc);
        }