Exemple #1
0
 private void CheckForDifferentEquipedItem()
 {
     if (description.ItemSlot != null)
     {
         var equipedItem = ItensSlots.Find(lambdaExpression =>
                                           lambdaExpression.IsEquiped && lambdaExpression != description.ItemSlot);
         if (equipedItem != null)
         {
             equipedItem.Equip(new Color(0.2f, 0.2f, 0.2f), false);
         }
     }
 }
Exemple #2
0
    private WeaponSlot AddWeapon(CollectibleWeapon weapon)
    {
        for (int i = 0; i < WeaponsSlots.Count; i++)
        {
            if (WeaponsSlots[i].Type == WeaponType.Nothing || WeaponsSlots[i].Type == weapon.WeaponType)
            {
                WeaponsSlots[i].FillWeapon(weapon);
                ItemSlot item = ItensSlots.Find(lambdaExpression =>
                                                lambdaExpression.Type == WeaponsSlots[i].BulletType);

                if (item != null)
                {
                    AddAmmo(WeaponsSlots[i], item.Quantity);
                    item.Reset();
                }
                return(weaponsSlots[i]);
            }
        }
        return(null);
    }
Exemple #3
0
    private ItemSlot AddItem(CollectibleItem item)
    {
        var inventoryItem = ItensSlots.Find(lambdaExpression => lambdaExpression.Type == item.ItemType);

        if (inventoryItem != null)
        {
            inventoryItem.Quantity += item.Quantity;
            inventoryItem.RenderItem();
            return(inventoryItem);
        }
        for (int i = 0; i < ItensSlots.Count; i++)
        {
            if (ItensSlots[i].Type == ItemType.Nothing)
            {
                ItensSlots[i].FillItem(item);
                return(ItensSlots[i]);
            }
        }
        return(null);
    }
Exemple #4
0
    private void CheckForSelection()
    {
        ItemSlot   itemSelected   = ItensSlots.Find(lambdaExpression => lambdaExpression.Toggle.isOn);
        WeaponSlot weaponSelected = WeaponsSlots.Find(lambdaExpression => lambdaExpression.Toggle.isOn);


        if (itemSelected != null && quickSelectionItens != null)
        {
            description.QuickItemSelectionPopUp.QuickItemSelectionList = quickSelectionItens;
            description.QuickItemSelectionPopUp.UpdateTexts();
        }

        if (itemSelected != null)
        {
            if (description.ItemSlot != null && itemSelected.Type != description.ItemSlot.Type)
            {
                description.RenderDescription();
            }
            else
            {
                description.RenderDescription(itemSelected);
            }
        }
        else if (weaponSelected != null)
        {
            if (description.WeaponSlot != null && weaponSelected.Type != description.WeaponSlot.Type)
            {
                description.RenderDescription();
            }
            else
            {
                description.RenderDescription(weaponSelected);
            }
        }
        else
        {
            description.RenderDescription();
        }
    }
Exemple #5
0
 public void CheckForCurrentItem()
 {
     CurrentItem = ItensSlots.Find(lambdaExpression =>
                                   lambdaExpression.IsEquiped);
 }