Exemple #1
0
        public virtual void Init(StringBuilder hudLabelText, Matrix localMatrix, MyAutocanonGun parentObject)
        {
            base.Init(hudLabelText, MyModelsEnum.Autocannon_Barrel, null, parentObject, null, null);
            LocalMatrix = Matrix.CreateTranslation(localMatrix.Translation);

            m_frustumCheckBeforeDrawEnabled = false;
            m_muzzleMatrix = ModelLod0.Dummies["MUZZLE_PARTICLE"].Matrix;
            Save           = false;
        }
        public virtual void Init(StringBuilder hudLabelText, Matrix localMatrix, MyAutocanonGun parentObject)
        {
            base.Init(hudLabelText, MyModelsEnum.Autocannon_Barrel, null, parentObject, null, null);
            LocalMatrix = Matrix.CreateTranslation(localMatrix.Translation);

            m_frustumCheckBeforeDrawEnabled = false;
            m_muzzleMatrix = ModelLod0.Dummies["MUZZLE_PARTICLE"].Matrix;
            Save = false;
        }
            /// <summary>
            /// Returns new instance of weapon
            /// </summary>
            /// <param name="weaponType">Weapon type</param>
            /// <returns></returns>
            public static MySmallShipGunBase GenerateWeapon(MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum weaponType)
            {
                MySmallShipGunBase newGun;

                switch (weaponType)
                {
                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Autocanon:
                    newGun = new MyAutocanonGun();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Automatic_Rifle_With_Silencer:
                    newGun = new MyAutomaticRifleSilencerGun();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Drilling_Device_Crusher:
                    newGun = new MyCrusherDrill();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Drilling_Device_Laser:
                    newGun = new MyLaserDrill();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Drilling_Device_Nuclear:
                    newGun = new MyNuclearDrill();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Drilling_Device_Saw:
                    newGun = new MySawDrill();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Drilling_Device_Thermal:
                    newGun = new MyThermalDrill();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Drilling_Device_Pressure:
                    newGun = new MyPressureDrill();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Missile_Launcher:
                    newGun = new MyMissileLauncherGun();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Harvesting_Device:
                    newGun = new MyHarvestingDevice();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Machine_Gun:
                    newGun = new MyMachineGun();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Cannon:
                    newGun = new MyCannonGun();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Shotgun:
                    newGun = new MyShotGun();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Sniper:
                    newGun = new MySniperGun();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Universal_Launcher_Back:
                    newGun = new MyUniversalLauncher();
                    break;

                case MyMwcObjectBuilder_SmallShip_Weapon_TypesEnum.Universal_Launcher_Front:
                    newGun = new MyUniversalLauncher();
                    break;

                default:
                    throw new MyMwcExceptionApplicationShouldNotGetHere();
                    break;
                }
                return(newGun);
            }