/// <summary> /// Checks if a gem fits into a given socket, taking into account settings for socket bonuses /// </summary> /// <param name="item">item class</param> /// <param name="socket">socket to check</param> /// <returns>yes = gem can fit</returns> public static bool GemFitsIn(WoWItemGemClass item, WoWSocketColor socket) { // if the gem is simple (ie, uncut) or not a gem, can't fit in any socket if (item == WoWItemGemClass.Simple || item == WoWItemGemClass.None) { return(false); } // if the gem is a meta gem, can only fit in a meta slot if (item == WoWItemGemClass.Meta) { return(socket == WoWSocketColor.Meta); } // if the gem is a prismatic, can fit in anything bar meta if (item == WoWItemGemClass.Prismatic) { return(socket != WoWSocketColor.Meta); } // if we're gemming for the bonus, check the socket matches or it's two types match if (EquipMeSettings.Instance.GemBonus) { if (item == WoWItemGemClass.Orange) { return(socket == WoWSocketColor.Red || socket == WoWSocketColor.Yellow); } else if (item == WoWItemGemClass.Green) { return(socket == WoWSocketColor.Yellow || socket == WoWSocketColor.Blue); } else if (item == WoWItemGemClass.Purple) { return(socket == WoWSocketColor.Blue || socket == WoWSocketColor.Red); } else { return(string.Equals(item.ToString(), socket.ToString(), StringComparison.OrdinalIgnoreCase)); } } // otherwise we can equip any coloured gem into any coloured socket return(true); }
/// <summary> /// Checks if a gem fits into a given socket, taking into account settings for socket bonuses /// </summary> /// <param name="item">item class</param> /// <param name="socket">socket to check</param> /// <returns>yes = gem can fit</returns> public static bool GemFitsIn(WoWItemGemClass item, WoWSocketColor socket) { // if the gem is simple (ie, uncut) or not a gem, can't fit in any socket if (item == WoWItemGemClass.Simple || item == WoWItemGemClass.None) { return false; } // if the gem is a meta gem, can only fit in a meta slot if (item == WoWItemGemClass.Meta) { return socket == WoWSocketColor.Meta; } // if the gem is a prismatic, can fit in anything bar meta if (item == WoWItemGemClass.Prismatic) { return socket != WoWSocketColor.Meta; } // if we're gemming for the bonus, check the socket matches or it's two types match if (EquipMeSettings.Instance.GemBonus) { if (item == WoWItemGemClass.Orange) { return socket == WoWSocketColor.Red || socket == WoWSocketColor.Yellow; } else if (item == WoWItemGemClass.Green) { return socket == WoWSocketColor.Yellow || socket == WoWSocketColor.Blue; } else if (item == WoWItemGemClass.Purple) { return socket == WoWSocketColor.Blue || socket == WoWSocketColor.Red; } else { return string.Equals(item.ToString(), socket.ToString(), StringComparison.OrdinalIgnoreCase); } } // otherwise we can equip any coloured gem into any coloured socket return true; }