示例#1
0
 public bool hasSlot(GameTypes.EquipmentSlots slot)
 {
     if (mSlots.Contains(slot))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#2
0
 private bool slotFilled(GameTypes.EquipmentSlots slot)
 {
     if (mSlotMap.ContainsKey(slot))
     {
         //the slot is filled
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#3
0
    //unequip the item if it is an equip item and it is equipped


    //-------------------------------------------------------------------------------------------------
    // public methods
    //-------------------------------------------------------------------------------------------------

    public void clearSlot(GameTypes.EquipmentSlots slot)
    {
        //is this slot filled?
        if (!hasSlot(slot) || mSlotMap.ContainsKey(slot) == false)
        {
            Debug.Log("The inventory doesnt have this slot, or it is not filled");
            return;
        }
        //find the item in the slot
        Debug.Log(slot.ToString());
        //if ( mSlotMap.ContainsKey(slot) == false ) return;
        EquipItem ei = mSlotMap[slot];

        //make sure it's valid
        if (!ei)
        {
            Debug.Log("The item in this slot is invalid");
            return;
        }
        //unequip the item
        unequipItem(ei);
    }