Exemple #1
0
        private void DeepestNodeNoModification(Node <T> root, int level, MaximumLevel maxLevel, ref Node <T> deepest)
        {
            if (root == null)
            {
                return;
            }

            if (root.Left == null && root.Right == null & maxLevel.Level < level)
            {
                maxLevel.Level = level;
                deepest        = root;
            }

            DeepestNodeNoModification(root.Left, level + 1, maxLevel, ref deepest);
            DeepestNodeNoModification(root.Right, level + 1, maxLevel, ref deepest);
        }
Exemple #2
0
        public void DeepestNodeWithMod(Node <T> root)
        {
            if (root == null)
            {
                return;
            }
            MaximumLevel maxLevel = new MaximumLevel();

            maxLevel.Level = 0;

            Node <T> deepest = null;

            DeepestNodeNoModification(root, 0, maxLevel, ref deepest);

            Console.WriteLine(deepest.Value);
            Console.WriteLine(maxLevel.Level);
        }
Exemple #3
0
        public bool Equals(DestinyVendorItemDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     VendorItemIndex == input.VendorItemIndex ||
                     (VendorItemIndex.Equals(input.VendorItemIndex))
                     ) &&
                 (
                     ItemHash == input.ItemHash ||
                     (ItemHash.Equals(input.ItemHash))
                 ) &&
                 (
                     Quantity == input.Quantity ||
                     (Quantity.Equals(input.Quantity))
                 ) &&
                 (
                     FailureIndexes == input.FailureIndexes ||
                     (FailureIndexes != null && FailureIndexes.SequenceEqual(input.FailureIndexes))
                 ) &&
                 (
                     Currencies == input.Currencies ||
                     (Currencies != null && Currencies.SequenceEqual(input.Currencies))
                 ) &&
                 (
                     RefundPolicy == input.RefundPolicy ||
                     (RefundPolicy != null && RefundPolicy.Equals(input.RefundPolicy))
                 ) &&
                 (
                     RefundTimeLimit == input.RefundTimeLimit ||
                     (RefundTimeLimit.Equals(input.RefundTimeLimit))
                 ) &&
                 (
                     CreationLevels == input.CreationLevels ||
                     (CreationLevels != null && CreationLevels.SequenceEqual(input.CreationLevels))
                 ) &&
                 (
                     DisplayCategoryIndex == input.DisplayCategoryIndex ||
                     (DisplayCategoryIndex.Equals(input.DisplayCategoryIndex))
                 ) &&
                 (
                     CategoryIndex == input.CategoryIndex ||
                     (CategoryIndex.Equals(input.CategoryIndex))
                 ) &&
                 (
                     OriginalCategoryIndex == input.OriginalCategoryIndex ||
                     (OriginalCategoryIndex.Equals(input.OriginalCategoryIndex))
                 ) &&
                 (
                     MinimumLevel == input.MinimumLevel ||
                     (MinimumLevel.Equals(input.MinimumLevel))
                 ) &&
                 (
                     MaximumLevel == input.MaximumLevel ||
                     (MaximumLevel.Equals(input.MaximumLevel))
                 ) &&
                 (
                     Action == input.Action ||
                     (Action != null && Action.Equals(input.Action))
                 ) &&
                 (
                     DisplayCategory == input.DisplayCategory ||
                     (DisplayCategory != null && DisplayCategory.Equals(input.DisplayCategory))
                 ) &&
                 (
                     InventoryBucketHash == input.InventoryBucketHash ||
                     (InventoryBucketHash.Equals(input.InventoryBucketHash))
                 ) &&
                 (
                     VisibilityScope == input.VisibilityScope ||
                     (VisibilityScope != null && VisibilityScope.Equals(input.VisibilityScope))
                 ) &&
                 (
                     PurchasableScope == input.PurchasableScope ||
                     (PurchasableScope != null && PurchasableScope.Equals(input.PurchasableScope))
                 ) &&
                 (
                     Exclusivity == input.Exclusivity ||
                     (Exclusivity != null && Exclusivity.Equals(input.Exclusivity))
                 ) &&
                 (
                     IsOffer == input.IsOffer ||
                     (IsOffer != null && IsOffer.Equals(input.IsOffer))
                 ) &&
                 (
                     IsCrm == input.IsCrm ||
                     (IsCrm != null && IsCrm.Equals(input.IsCrm))
                 ) &&
                 (
                     SortValue == input.SortValue ||
                     (SortValue.Equals(input.SortValue))
                 ) &&
                 (
                     ExpirationTooltip == input.ExpirationTooltip ||
                     (ExpirationTooltip != null && ExpirationTooltip.Equals(input.ExpirationTooltip))
                 ) &&
                 (
                     RedirectToSaleIndexes == input.RedirectToSaleIndexes ||
                     (RedirectToSaleIndexes != null && RedirectToSaleIndexes.SequenceEqual(input.RedirectToSaleIndexes))
                 ) &&
                 (
                     SocketOverrides == input.SocketOverrides ||
                     (SocketOverrides != null && SocketOverrides.SequenceEqual(input.SocketOverrides))
                 ) &&
                 (
                     Unpurchasable == input.Unpurchasable ||
                     (Unpurchasable != null && Unpurchasable.Equals(input.Unpurchasable))
                 ));
        }