/// <summary> /// Returns true if successful and false if not. /// </summary> /// <param name="gem"></param> public bool InsertGem(EquipmentScriptableObject.GemColor gem) { for (int i = 0; i < CurrentSockets.Length; i++) { if (CurrentSockets[i] == EquipmentScriptableObject.GemColor.Empty) { CurrentSockets[i] = gem; return(true); } } return(false); }
public bool RemoveGem(EquipmentScriptableObject.GemColor gem, Equipment.Slot slot, int trinketSlot = -1) { if (slot == Equipment.Slot.Trinket) { if (trinketSlot < 0) { return(false); } if (currentEquipment[slot][trinketSlot].SocketCount < 1) { return(false); } if (currentEquipment[Equipment.Slot.Trinket][trinketSlot].RemoveGem(gem)) { RefreshCards(); return(true); } return(false); } else { if (currentEquipment[slot][0].SocketCount < 1) { return(false); } if (currentEquipment[slot][0].RemoveGem(gem)) { RefreshCards(); return(true); } return(false); } }