Пример #1
0
        public void UnequipModule(ShipNode node, bool addToInventory)
        {
            if (node.Empty)
            {
                return;
            }
            if (addToInventory)
            {
                shipInventory.AddItem(node.Module, 1);
            }
            node.Empty  = true;
            node.Module = null;

            UpdateShipStats();
        }
Пример #2
0
        public void EquipModule(ShipNode node, ShipMod mod, bool removeFromInventory)
        {
            if (node.ModType == mod.ModType || node.ModType == ShipMod.ShipModTypes.Any)
            {
                if (removeFromInventory)
                {
                    shipInventory.RemoveItem(mod, 1);
                }
                if (!node.Empty)
                {
                    shipInventory.AddItem(node.Module, 1);
                }

                node.Empty  = false;
                node.Module = mod;

                UpdateShipStats();
            }
        }