Exemplo n.º 1
0
        public void ChangeWeapon()
        {
            if (weapons.Count == 0)
            {
                return;
            }
            var index = weapons.IndexOf(CurrentWeapon);

            if (index + 1 < weapons.Count)
            {
                CurrentWeapon = weapons[index + 1];
                NotifyWeaponChanged?.Invoke();
                return;
            }

            CurrentWeapon = weapons[0];
            NotifyWeaponChanged?.Invoke();
        }
Exemplo n.º 2
0
 public void AddWeapon(Weapon.Weapon weapon)
 {
     weapons.Add(weapon);
     CurrentWeapon = weapon;
     NotifyWeaponChanged?.Invoke();
 }