예제 #1
0
 /// <summary>
 /// Removes drill from ship
 /// </summary>
 public void RemoveDrill()
 {
     if (DrillSlot.IsMounted())
     {
         RemoveWeaponFromSlotAndFromShip(DrillSlot);
     }
 }
예제 #2
0
 /// <summary>
 /// Returns mounted drill
 /// </summary>
 /// <returns></returns>
 public MyDrillBase GetMountedDrill()
 {
     if (DrillSlot.IsMounted())
     {
         return(DrillSlot.MountedWeapon as MyDrillBase);
     }
     return(null);
 }
예제 #3
0
 /// <summary>
 /// Adds drill
 /// </summary>
 /// <param name="weapon">Drill</param>
 /// <param name="weaponObjectBuilder">Drill's object builder</param>
 private void AddDrill(MyDrillBase drill, MyMwcObjectBuilder_SmallShip_Weapon drillObjectBuilder)
 {
     if (DrillSlot.IsMounted())
     {
         RemoveWeaponFromSlotAndFromShip(DrillSlot);
     }
     AddWeaponToSlot(DrillSlot, drill, drillObjectBuilder);
 }
예제 #4
0
        /// <summary>
        /// Close all weapons
        /// </summary>
        public void Close()
        {
            //foreach (MySmallShipGunBase gun in GetMountedWeaponstWithHarvesterAndDrill())
            //{
            //    gun.Close();
            //}
            foreach (MyWeaponSlot weaponSlot in WeaponSlots)
            {
                if (weaponSlot != null)
                {
                    weaponSlot.OnWeaponDismouting -= m_weaponDismounting;
                    weaponSlot.OnWeaponMounting   -= m_weaponMounting;
                    weaponSlot.Close();
                }
            }
            WeaponSlots.Clear();
            WeaponSlots = null;

            DrillSlot.OnWeaponDismouting -= m_weaponDismounting;
            DrillSlot.OnWeaponMounting   -= m_weaponMounting;
            DrillSlot.Close();
            DrillSlot = null;

            HarvestingDeviceSlot.OnWeaponDismouting -= m_weaponDismounting;
            HarvestingDeviceSlot.OnWeaponMounting   -= m_weaponMounting;
            HarvestingDeviceSlot.Close();
            HarvestingDeviceSlot = null;

            m_allMountedWeapons.Clear();
            m_allMountedWeapons = null;

            AmmoAssignments.Close();
            AmmoAssignments = null;

            AmmoInventoryItems.Close();
            AmmoAssignments = null;

            Ship.Inventory.OnInventoryContentChange -= OnInventoryContentChange;
            Ship = null;

            m_helperInventoryItems.Clear();
            m_helperInventoryItems = null;

            m_isClosed = true;
        }