// Adds one weapon or device to this large ship void AddWeapon(MyMwcObjectBuilder_LargeShip_Weapon weaponObjectBuilder) { Vector3 position = new Vector3(weaponObjectBuilder.PositionAndOrientation.Position.X, weaponObjectBuilder.PositionAndOrientation.Position.Y, weaponObjectBuilder.PositionAndOrientation.Position.Z); switch (weaponObjectBuilder.WeaponType) { case MyMwcObjectBuilder_LargeShip_Weapon_TypesEnum.CIWS: { //MyLargeShipWeaponCIWS newGun = new MyLargeShipWeaponCIWS(); //newGun.Init(new StringBuilder("CIWS gun"), position, m_ship, weaponObjectBuilder); //m_guns.Add(newGun); break; } case MyMwcObjectBuilder_LargeShip_Weapon_TypesEnum.MachineGun: { MyLargeShipMachineGun newGun = new MyLargeShipMachineGun(); newGun.Init(new StringBuilder("Large machine gun"), m_ship, position, m_ship.WorldMatrix.Forward, m_ship.WorldMatrix.Up, null); m_guns.Add(newGun); } break; default: throw new MyMwcExceptionApplicationShouldNotGetHere(); break; } }
// Adds one weapon or device to this large ship void AddWeapon(MyMwcObjectBuilder_LargeShip_Weapon weaponObjectBuilder) { Vector3 position = new Vector3(weaponObjectBuilder.PositionAndOrientation.Position.X, weaponObjectBuilder.PositionAndOrientation.Position.Y, weaponObjectBuilder.PositionAndOrientation.Position.Z); switch (weaponObjectBuilder.WeaponType) { case MyMwcObjectBuilder_LargeShip_Weapon_TypesEnum.CIWS: { //MyLargeShipWeaponCIWS newGun = new MyLargeShipWeaponCIWS(); //newGun.Init(new StringBuilder("CIWS gun"), position, m_ship, weaponObjectBuilder); //m_guns.Add(newGun); break; } case MyMwcObjectBuilder_LargeShip_Weapon_TypesEnum.MachineGun: { MyLargeShipMachineGun newGun = new MyLargeShipMachineGun(); newGun.Init(new StringBuilder("Large machine gun"), m_ship, position, m_ship.WorldMatrix.Forward, m_ship.WorldMatrix.Up, null); m_guns.Add(newGun); } break; default: throw new MyMwcExceptionApplicationShouldNotGetHere(); break; } }