コード例 #1
0
        /// <summary>
        /// Assigns / Attaches equipment item to the open equipment type and ship list.
        /// </summary>
        public bool AssignItem(string itemID)
        {
            ShipInfo selectedShip = shipDataServicer.GetShipItem(shipID);

            /*print("Has been encountered");
             * print("Item ID: " + itemID);
             * print(shipID);
             * print(selectedShip);*/

            if (equipmentType == EquipmentType.ForwardWeapon)
            {
                if (selectedShip.CheckIsFull(WeaponConfiguration.Forward))
                {
                    return(false);
                }
                selectedShip.AssignWeapons(WeaponConfiguration.Forward, itemID);
                // print("Has assigned weapon");
            }

            if (equipmentType == EquipmentType.TurrentWeapon)
            {
                if (selectedShip.CheckIsFull(WeaponConfiguration.Turrent))
                {
                    return(false);
                }
                selectedShip.AssignWeapons(WeaponConfiguration.Turrent, itemID);
                //print("Has assigned weapon");
            }

            ResetEquipmentList();
            return(false);
        }