Fix Challenge stages (more): some must be repeated.

This commit is contained in:
MaikyM 2019-12-20 12:27:31 -06:00
parent 722313f28b
commit c508aac93a
2 changed files with 16 additions and 14 deletions

View File

@ -147,16 +147,16 @@ namespace FModel.Methods.Assets.IconCreator.ChallengeID
rewardQuantity = targetQuantity.Value<string>();
}
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, rewardPath, rewardQuantity);
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount))
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, rewardPath, rewardQuantity, assetPath);
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount && string.Equals(item.TheAssetPath, currentData.TheAssetPath)))
{
BundleData.Add(currentData);
}
}
else
{
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, "", "");
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount))
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, "", "", assetPath);
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount && string.Equals(item.TheAssetPath, currentData.TheAssetPath)))
{
BundleData.Add(currentData);
}
@ -184,8 +184,8 @@ namespace FModel.Methods.Assets.IconCreator.ChallengeID
rewardQuantity = hiddenQuantityToken.Value<string>();
}
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, rewardPath, rewardQuantity);
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount))
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, rewardPath, rewardQuantity, assetPath);
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount && string.Equals(item.TheAssetPath, currentData.TheAssetPath)))
{
BundleData.Add(currentData);
}
@ -194,8 +194,8 @@ namespace FModel.Methods.Assets.IconCreator.ChallengeID
}
else
{
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, "", "");
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount))
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, "", "", assetPath);
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount && string.Equals(item.TheAssetPath, currentData.TheAssetPath)))
{
BundleData.Add(currentData);
}
@ -239,8 +239,8 @@ namespace FModel.Methods.Assets.IconCreator.ChallengeID
rewardQuantity = quantityToken["tag_data"].Value<string>();
}
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, rewardPath, rewardQuantity);
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount))
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, rewardPath, rewardQuantity, assetPath);
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount && string.Equals(item.TheAssetPath, currentData.TheAssetPath)))
{
BundleData.Add(currentData);
}
@ -253,8 +253,8 @@ namespace FModel.Methods.Assets.IconCreator.ChallengeID
}
else
{
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, "", "");
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount))
BundleInfosEntry currentData = new BundleInfosEntry(questDescription, questCount, unlockType, "", "", assetPath);
if (!BundleData.Any(item => item.TheQuestDescription.Equals(currentData.TheQuestDescription, StringComparison.InvariantCultureIgnoreCase) && item.TheQuestCount == currentData.TheQuestCount && string.Equals(item.TheAssetPath, currentData.TheAssetPath)))
{
BundleData.Add(currentData);
}

View File

@ -1,4 +1,4 @@
using PakReader;
using PakReader;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
@ -98,14 +98,16 @@ namespace FModel.Methods
public string TheQuestUnlockType { get; set; }
public string TheRewardPath { get; set; }
public string TheRewardQuantity { get; set; }
public string TheAssetPath { get; set; }
internal BundleInfosEntry(string MyQuestDescription, long MyQuestCount, string MyQuestUnlockType, string MyRewardPath, string MyRewardQuantity)
internal BundleInfosEntry(string MyQuestDescription, long MyQuestCount, string MyQuestUnlockType, string MyRewardPath, string MyRewardQuantity, string MyAssetPath)
{
TheQuestDescription = MyQuestDescription;
TheQuestCount = MyQuestCount;
TheQuestUnlockType = MyQuestUnlockType;
TheRewardPath = MyRewardPath;
TheRewardQuantity = MyRewardQuantity;
TheAssetPath = MyAssetPath;
}
bool IEquatable<BundleInfosEntry>.Equals(BundleInfosEntry other)