Пример #1
0
        ///<summary>
        ///deploy/carry/mount/hold weapon
        ///</summary>
        ///<param name="weapon">weapon to hold</param>
        public void HoldWeapon(Weapon weapon)
        {
            if (null == weapon && null != _currentWeapon)
            {
                UnmountShape(_currentWeapon);
                _currentWeapon = null;
            }
            else if (weapon != null)
            {
                //TODO: need more weapon models
                switch (weapon.WeaponType)
                {
                    case WeaponTypes.Railgun:
                        if (null == _gl)
                        {
                            _gl = new GrenadeLauncher();
                        }
                        _currentWeapon = _gl;
                        break;

                    case WeaponTypes.RocketLauncher:
                        if (null == _gl)
                        {
                            _gl = new GrenadeLauncher();
                        }
                        _currentWeapon = _gl;
                        break;

                    case WeaponTypes.Shotgun:
                        if (null == _rifle)
                        {
                            _rifle = new Rifle();
                        }
                        _currentWeapon = _rifle;
                        break;

                        //case WeaponTypes.Blaster:
                    default:
                        if (null == _rifle)
                        {
                            _rifle = new Rifle();
                        }
                        _currentWeapon = _rifle;
                        break;
                }
                MountShape(_currentWeapon, "Mount0");
            }
        }
Пример #2
0
 ///<summary>
 ///deploy/carry/mount/hold weapon
 ///</summary>
 ///<param name="weapon">weapon to hold</param>
 public void HoldWeapon(Weapon weapon)
 {
     ((IBotSceneObject) SceneObject).HoldWeapon(weapon);
 }
Пример #3
0
        ///<summary>
        ///deploy/carry/mount/hold weapon
        ///</summary>
        ///<param name="weapon">weapon to hold</param>
        public void HoldWeapon(Weapon weapon)
        {
            //if (null == weapon && null != _currentWeapon)
            //{
            //    _currentWeapon = null;
            //}
            //else if (weapon != null)
            //{
            //    //TODO: need more weapon models
            //    switch (weapon.WeaponType)
            //    {
            //        case WeaponTypes.Railgun:
            //            break;

            //        case WeaponTypes.RocketLauncher:
            //            break;

            //        case WeaponTypes.Shotgun:
            //            break;

            //        //case WeaponTypes.Blaster:
            //        default:
            //            break;
            //    }
            //}
        }