Exemple #1
0
            /* Return true if the item has been added */
            public static bool AddItem(Item itemToAdd)
            {
                // If the item is a tool

                if (itemToAdd.typeOfCollectableItem == Item.TypeOfCollectableItem.Tool)
                {
                    // Add it in the ToolManagement

                    if (ToolManagement.AddTool((Tool)itemToAdd))
                    {
                        _characterSheet.AddTool((Tool)itemToAdd);
                        return(true);
                    }
                    return(false);
                }

                // If it's not a tool

                int indexItemToAdd = ItemExistsAndStackableInInventory(itemToAdd);

                // If the item doesn't exists or there is a stack with 99 items

                if (indexItemToAdd == -1)
                {
                    for (int i = 0; i < _myInventory.Length; i++)
                    {
                        if (_myInventory[i].IsEmpty)
                        {
                            AddItemAt(itemToAdd, i);
                            return(true);
                        }
                    }

                    // If there is no more slot left

                    return(false);
                }

                // If the item exists and one can be added

                _myInventory[indexItemToAdd].gameObject.GetComponentInChildren <Text>().text =
                    (++_myInventory[indexItemToAdd].NumberOfSameItem).ToString();

                return(true);
            }
Exemple #2
0
        public override void Execute()
        {
            PxLogin.LogIn("admin", "123");

            var toolsForm = new ToolManagement();

            toolsForm.OpenScreen();

            toolsForm.Insert();
            toolsForm.Summary.Toolcd.Type("ABC");
            toolsForm.Summary.Description.Type("My new tool");
            toolsForm.Summary.SerialNumber.Type("XYZ");             //System should complain that serial number doesn't start with BOB-.

            toolsForm.Save();

            toolsForm.Summary.SerialNumber.Type("BOB-1234");
            toolsForm.Save();
        }
Exemple #3
0
 public static void InitializeAwakes()
 {
     RuneManagement.InitRunes();
     ToolManagement.InitTools();
 }