コード例 #1
0
ファイル: GearTypeRunner.cs プロジェクト: kakesu/Procurement
        public override bool IsCompatibleType(Gear item)
        {
            if (item.TypeLine.Contains("Ring") && !incompatibleTypes.Any(t => item.TypeLine.Contains(t)))
                return true;

            return false;
        }
コード例 #2
0
        public static GearType GetType(Gear item)
        {
            foreach (var runner in runners)
                if (runner.IsCompatibleType(item))
                    return runner.Type;

            return GearType.Unknown;
        }
コード例 #3
0
ファイル: GearTypeRunner.cs プロジェクト: kakesu/Procurement
        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;
        }
コード例 #4
0
ファイル: ChromaticRecipe.cs プロジェクト: keeper/Procurement
        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;
        }
コード例 #5
0
ファイル: GearTypeRunner.cs プロジェクト: kakesu/Procurement
        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;
        }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
ファイル: ChromaticRecipe.cs プロジェクト: keeper/Procurement
        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;
        }
コード例 #8
0
 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;
 }
コード例 #9
0
ファイル: GearTypeRunner.cs プロジェクト: mihailim/modrank
 public abstract bool IsCompatibleType(Gear item);
コード例 #10
0
ファイル: GearTypeRunner.cs プロジェクト: mihailim/modrank
 public abstract string GetBaseType(Gear item);
コード例 #11
0
 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;
     }
 }
コード例 #12
0
 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"));
 }
コード例 #13
0
        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"));
        }
コード例 #14
0
        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;
        }
コード例 #15
0
 public abstract string GetBaseType(Gear item);
コード例 #16
0
 public abstract bool IsCompatibleType(Gear item);