/// <summary> /// Removes drill from ship /// </summary> public void RemoveDrill() { if (DrillSlot.IsMounted()) { RemoveWeaponFromSlotAndFromShip(DrillSlot); } }
/// <summary> /// Returns mounted drill /// </summary> /// <returns></returns> public MyDrillBase GetMountedDrill() { if (DrillSlot.IsMounted()) { return(DrillSlot.MountedWeapon as MyDrillBase); } return(null); }
/// <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); }
/// <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; }