public override bool IsCompatibleType(Gear item) { if (item.TypeLine.Contains("Ring") && !incompatibleTypes.Any(t => item.TypeLine.Contains(t))) return true; return false; }
public static GearType GetType(Gear item) { foreach (var runner in runners) if (runner.IsCompatibleType(item)) return runner.Type; return GearType.Unknown; }
public override string GetBaseType(Gear item) { if (incompatibleTypes != null && incompatibleTypes.Any(t => item.TypeLine.Contains(t))) return null; foreach (var type in compatibleTypes) if (item.TypeLine.Contains(type)) return type; return null; }
private RecipeResult getResult(Gear item) { RecipeResult result = new RecipeResult(); result.Instance = this; result.PercentMatch = 100; result.IsMatch = true; result.MatchedItems = new List<Item> { item }; result.Missing = new List<string>(); return result; }
public override bool IsCompatibleType(Gear item) { // First, check the general types, to see if there is an easy match. foreach (var type in generalTypes) if (item.TypeLine.Contains(type)) return true; // Second, check all known types. foreach (var type in compatibleTypes) if (item.TypeLine.Contains(type)) return true; return false; }
private void setGearProperties(Item item, Gear gear) { this.Requirements = gear.Requirements; this.ImplicitMods = gear.Implicitmods; if (gear.FlavourText != null && gear.FlavourText.Count > 0) { var builder = new StringBuilder(); foreach (var text in ((Gear)(item)).FlavourText) builder.Append(text); DescriptionText = builder.ToString(); } }
private bool isMatch(Gear gear) { if (gear.NumberOfSockets() == 6) return false; var canditates = gear.Sockets.GroupBy(g => g.Group) .Where(grp => grp.Count() >= 3); foreach (var group in canditates) { if (group.Select(s => s.Attribute).Distinct().Count() == 3) return true; } return false; }
public static string GetBaseType(Gear item) { foreach (var runner in runners) { // If we know the GearType of the item, only query the GearTypeRunner for // that type. If the GearType is unknown, query all of them. if (item.GearType == GearType.Unknown || item.GearType == runner.Type) { string baseType = runner.GetBaseType(item); if (!string.IsNullOrWhiteSpace(baseType)) { return baseType; } } } return null; }
public abstract bool IsCompatibleType(Gear item);
public abstract string GetBaseType(Gear item);
private void CheckWeaponCompatibility(Gear selected) { //Special check for weapons compatibility offhandButton.IsEnabled = true; MHIsBow = false; if (selected.GearType == GearType.Wand) { MHIsWand = true; if (equipped.Offhand != null && (equipped.Offhand as Gear).GearType != GearType.Wand) { davinci.Children.Remove(itemViews["Offhand"]); itemViews["Offhand"] = null; equipped.Offhand = null; } } else { MHIsWand = false; if (equipped.Offhand != null && (equipped.Offhand as Gear).GearType == GearType.Wand) { davinci.Children.Remove(itemViews["Offhand"]); itemViews["Offhand"] = null; equipped.Offhand = null; } } if (selected.GearType == GearType.Staff || selected.GearType == GearType.Bow || selected.Properties[0].Name.Contains("Two Handed")) { if (itemViews.ContainsKey("Offhand")) davinci.Children.Remove(itemViews["Offhand"]); itemViews["Offhand"] = null; equipped.Offhand = null; if (selected.GearType != GearType.Bow) offhandButton.IsEnabled = false; else MHIsBow = true; } }
private Gem getSocketItemAt(Tuple<int, int> nextAvail, Socket socket, int socketIndex, Gear item) { return item.SocketedItems.First(i => i.Socket == socketIndex && (socket.Attribute == i.Color || socket.Attribute == "G" || i.Color == "G")); }
private bool isSocketed(Tuple<int, int> nextAvail, Socket socket, int socketIndex, Gear item) { if (item.SocketedItems == null || item.SocketedItems.Count == 0) return false; return item.SocketedItems.Exists(i => i.Socket == socketIndex && (socket.Attribute == i.Color || socket.Attribute == "G" || i.Color == "G")); }
public override bool IsCompatibleType(Gear item) { //System.Threading.Thread.CurrentThread.CurrentCulture. // if (item.TypeLine.Contains(Lang.RingStrValue) && !incompatibleTypes.Any(t => item.TypeLine.Contains(t))) if (culture.CompareInfo.IndexOf(item.TypeLine, Lang.RingStrValue, CompareOptions.IgnoreCase) >= 0 && !incompatibleTypes.Any(t => item.TypeLine.Contains(t))) return true; return false; }