Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions SimcProfileParser.Tests/DataSync/RawDataExtractionServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,35 +399,6 @@ public void RDE_Generates_RppmData()
ClassicAssert.AreEqual(-0.5000, firstResult.Coefficient, "Coefficient");
}

[Test]
public void RDE_Generates_ConduitRankData()
{
// Arrange
RawDataExtractionService rawDataExtractionService =
new RawDataExtractionService(null);

var incomingRawData = new Dictionary<string, string>()
{
{ "CovenantData.raw", "__conduit_rank_data { {\r\n" +
"{ 41, 0, 337078, 10.000000 },\r\n" +
"{ 41, 1, 337078, 11.000000 },\r\n" +
"};"}
};

// Act
var result = rawDataExtractionService.GenerateConduitRankData(incomingRawData);
var firstResult = result.FirstOrDefault();

// Assert
ClassicAssert.IsNotNull(result);
ClassicAssert.AreEqual(2, result.Count);
ClassicAssert.IsNotNull(firstResult);
ClassicAssert.AreEqual(337078, firstResult.SpellId, "Spell Id");
ClassicAssert.AreEqual(41, firstResult.ConduitId, "Conduit Id");
ClassicAssert.AreEqual(10.000000, firstResult.Value, "Value");
ClassicAssert.AreEqual(0, firstResult.Rank, "Rank");
}

[Test]
public void RDE_Generates_ItemEffectData()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public void SimcParsedProfile_Collections_Not_Null()
var spp = new SimcParsedProfile();

// Assert
ClassicAssert.IsNotNull(spp.Soulbinds);
ClassicAssert.IsNotNull(spp.Conduits);
ClassicAssert.IsNotNull(spp.Professions);
ClassicAssert.IsNotNull(spp.Items);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ public async Task SGS_Creates_Profile()
ClassicAssert.NotZero(profile.ParsedProfile.Level);
ClassicAssert.NotZero(profile.GeneratedItems.Count);
ClassicAssert.IsTrue(profile.GeneratedItems[0].Equipped);
ClassicAssert.NotZero(profile.ParsedProfile.Conduits.Count);
ClassicAssert.NotZero(profile.ParsedProfile.Conduits[0].SpellId);
ClassicAssert.NotZero(profile.ParsedProfile.Soulbinds.Count);
ClassicAssert.NotZero(profile.ParsedProfile.Soulbinds[0].SocketedConduits.Count);
ClassicAssert.NotZero(profile.ParsedProfile.Soulbinds[0].SocketedConduits[0].SpellId);
ClassicAssert.IsNotNull(profile.Talents);
ClassicAssert.AreEqual(0, profile.Talents.Count);
//Assert.AreEqual(103775, profile.Talents[0].TraitEntryId);
Expand Down
108 changes: 0 additions & 108 deletions SimcProfileParser.Tests/SimcParserService_ParseProfileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,49 +187,6 @@ public void SPS_Parses_Renown()
ClassicAssert.AreEqual(renown, ParsedProfile.Renown);
}

[Test]
public void SPS_Parses_Covenant()
{
// Arrange
var covenant = "night_fae";

// Act

// Assert
ClassicAssert.IsNotNull(ParsedProfile);
ClassicAssert.IsNotNull(ParsedProfile.Covenant);
ClassicAssert.AreEqual(covenant, ParsedProfile.Covenant);
}

[Test]
public void SPS_Parses_Conduits()
{
// Arrange
// 116:1/78:1/82:1/84:1/101:1/69:1/73:1/67:1/66:1
var allConduits = new List<SimcParsedConduit>()
{
new SimcParsedConduit() { ConduitId = 116, Rank = 1 },
new SimcParsedConduit() { ConduitId = 78, Rank = 7 },
new SimcParsedConduit() { ConduitId = 82, Rank = 1 },
new SimcParsedConduit() { ConduitId = 84, Rank = 1 },
new SimcParsedConduit() { ConduitId = 101, Rank = 1 },
new SimcParsedConduit() { ConduitId = 69, Rank = 1 },
new SimcParsedConduit() { ConduitId = 73, Rank = 1 },
new SimcParsedConduit() { ConduitId = 67, Rank = 10 },
new SimcParsedConduit() { ConduitId = 66, Rank = 1 },
};

// Act
var expectedConduits = JsonConvert.SerializeObject(allConduits);
var actualConduits = JsonConvert.SerializeObject(ParsedProfile.Conduits);

// Assert
ClassicAssert.IsNotNull(ParsedProfile);
ClassicAssert.IsNotNull(ParsedProfile.Conduits);
ClassicAssert.NotZero(ParsedProfile.Conduits.Count);
ClassicAssert.AreEqual(expectedConduits, actualConduits);
}

[Test]
public void SPS_Parses_Talents()
{
Expand Down Expand Up @@ -264,71 +221,6 @@ public void SPS_Parses_Class()
ClassicAssert.AreEqual(classId, ParsedProfile.ClassId);
}

[Test]
public void SPS_Parses_Soulbinds()
{
// Arrange
// # soulbind=niya:1,342270/82:1/73:1/320662/69:1/84:1/320668/322721
// soulbind = dreamweaver:2,319191 / 82:1 / 66:1 / 319213 / 69:1 / 84:1 / 319216 / 319217
// # soulbind=korayn:6,
var allSoulbinds = new List<SimcParsedSoulbind>()
{
new SimcParsedSoulbind()
{
Name = "niya",
SoulbindId = 1,
IsActive = false,
SocketedConduits = new List<SimcParsedConduit>()
{
new SimcParsedConduit() { ConduitId = 82, Rank = 1 },
new SimcParsedConduit() { ConduitId = 73, Rank = 1 },
new SimcParsedConduit() { ConduitId = 69, Rank = 1 },
new SimcParsedConduit() { ConduitId = 84, Rank = 1 }
},
SoulbindSpells = new List<int>()
{
342270, 320662, 320668, 322721
}
},
new SimcParsedSoulbind()
{
Name = "dreamweaver",
SoulbindId = 2,
IsActive = true,
SocketedConduits = new List<SimcParsedConduit>()
{
new SimcParsedConduit() { ConduitId = 82, Rank = 1 },
new SimcParsedConduit() { ConduitId = 66, Rank = 1 },
new SimcParsedConduit() { ConduitId = 69, Rank = 1 },
new SimcParsedConduit() { ConduitId = 84, Rank = 1 }
},
SoulbindSpells = new List<int>()
{
319191, 319213, 319216, 319217
}
},
new SimcParsedSoulbind()
{
Name = "korayn",
SoulbindId = 6,
IsActive = false,
SocketedConduits = new List<SimcParsedConduit>(),
SoulbindSpells = new List<int>()
}
};

// Act
var expectedSoulbinds = JsonConvert.SerializeObject(allSoulbinds);
var actualSoulbinds = JsonConvert.SerializeObject(ParsedProfile.Soulbinds);

// Assert
ClassicAssert.IsNotNull(ParsedProfile);
ClassicAssert.IsNotNull(ParsedProfile.Soulbinds);
ClassicAssert.NotZero(ParsedProfile.Soulbinds.Count);
ClassicAssert.AreEqual(expectedSoulbinds, actualSoulbinds);
}


[Test]
public void SPS_Parses_Professions()
{
Expand Down
20 changes: 0 additions & 20 deletions SimcProfileParser.Tests/SimcSpellCreationServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,26 +258,6 @@ public async Task SSC_Creates_Player_Spell_WithPower()
ClassicAssert.AreEqual(137031, spell.PowerCosts.Skip(1).First().Key);
}

[Test]
public async Task SSC_Creates_Player_Spell_WithConduitRanks()
{
// Arrange
var playerLevel = 80u;
var spellId = 340609u;

// Act
var spell = await _spellCreationService.GeneratePlayerSpellAsync(playerLevel, spellId);
var firstConduitRank = spell.ConduitRanks.FirstOrDefault();

// Assert
ClassicAssert.IsNotNull(spell);
ClassicAssert.IsNotNull(spell.ConduitRanks);
ClassicAssert.AreEqual(270, spell.ConduitId);
ClassicAssert.IsNotNull(firstConduitRank);
ClassicAssert.AreEqual(15, firstConduitRank.Value);
ClassicAssert.AreEqual(0, firstConduitRank.Key);
}

[Test]
public async Task SSC_Creates_Item_Spell_RppmSpecModifiers()
{
Expand Down
10 changes: 0 additions & 10 deletions SimcProfileParser/DataSync/CacheService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,6 @@ public CacheService(IRawDataExtractionService rawDataExtractionService,
}
});

((ICacheService)this).RegisterFileConfiguration(new CacheFileConfiguration()
{
LocalParsedFile = "CovenantData.json",
ParsedFileType = SimcParsedFileType.CovenantData,
RawFiles = new Dictionary<string, string>()
{
{ "CovenantData.raw", "covenant_data" }
}
});

((ICacheService)this).RegisterFileConfiguration(new CacheFileConfiguration()
{
LocalParsedFile = "ItemEffectData.json",
Expand Down
55 changes: 0 additions & 55 deletions SimcProfileParser/DataSync/RawDataExtractionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public object GenerateData(SimcParsedFileType fileType, Dictionary<string, strin
SimcParsedFileType.SpellScaleMultipliers => GenerateSpellScalingMultipliers(incomingRawData),
SimcParsedFileType.CurvePoints => GenerateCurveData(incomingRawData),
SimcParsedFileType.RppmData => GenerateRppmData(incomingRawData),
SimcParsedFileType.CovenantData => GenerateConduitRankData(incomingRawData),
SimcParsedFileType.ItemEffectData => GenerateItemEffectData(incomingRawData),
SimcParsedFileType.GameDataVersion => GenerateGameDataVersion(incomingRawData),
SimcParsedFileType.TraitData => GenerateTraitData(incomingRawData),
Expand Down Expand Up @@ -1115,60 +1114,6 @@ internal List<SimcRawRppmEntry> GenerateRppmData(Dictionary<string, string> inco
return rppmData;
}

internal List<SimcRawSpellConduitRankEntry> GenerateConduitRankData(Dictionary<string, string> incomingRawData)
{
var rawData = incomingRawData.Where(d => d.Key == "CovenantData.raw").FirstOrDefault().Value;

// Split the raw data to only be the parts we want.
string key = "_conduit_rank_data {";

int start = rawData.IndexOf(key) + key.Length;
int end = rawData.IndexOf("};", start);

var dataChunk = rawData[start..end];

var lines = dataChunk.Split(
new[] { "\r\n", "\r", "\n" },
StringSplitOptions.None
);

var conduitRankEntries = new List<SimcRawSpellConduitRankEntry>();

foreach (var line in lines)
{
// Split the data up
var data = line.Split(',');

// Only process valid lines
if (data.Count() != 5)
continue;

var conduitRank = new SimcRawSpellConduitRankEntry();

// Clean the data up
for (var i = 0; i < data.Length; i++)
{
data[i] = data[i].Replace("}", "").Replace("{", "").Trim();
}

// 0 is curve Id
conduitRank.ConduitId = Convert.ToUInt32(data[0]);

// 1 is rank
conduitRank.Rank = Convert.ToUInt32(data[1]);

// 2 is spell id
conduitRank.SpellId = Convert.ToUInt32(data[2]);

// 3 is spell id
conduitRank.Value = ToDoubleClean(data[3]);

conduitRankEntries.Add(conduitRank);
}

return conduitRankEntries;
}

internal string GenerateGameDataVersion(Dictionary<string, string> incomingRawData)
{
var rawData = incomingRawData.Where(d => d.Key == "GameDataVersion.raw").FirstOrDefault().Value;
Expand Down
1 change: 0 additions & 1 deletion SimcProfileParser/Interfaces/ISimcSpellCreationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ public interface ISimcSpellCreationService
Task<SimcSpell> GenerateItemSpellAsync(SimcSpellOptions spellOptions);
Task<SimcSpell> GeneratePlayerSpellAsync(uint playerLevel, uint spellId);
Task<SimcSpell> GeneratePlayerSpellAsync(SimcSpellOptions spellOptions);
Task<uint> GetSpellIdFromConduitIdAsync(uint conduitId);
}
}
2 changes: 0 additions & 2 deletions SimcProfileParser/Interfaces/ISimcUtilityService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ interface ISimcUtilityService
Task<List<SimcRawRppmEntry>> GetSpellRppmModifiersAsync(uint spellId);
Task<double> GetSpellScalingMultiplierAsync(int scaleIndex, int playerLevel);
Task<double> GetStaminaMultiplierAsync(int itemLevel, CombatRatingMultiplayerType staminaRatingType);
Task<List<SimcRawSpellConduitRankEntry>> GetSpellConduitRanksAsync(uint spellId);
Task<uint> GetSpellConduitSpellIdAsync(uint conduitId);
Task<SimcRawItemEffect> GetItemEffectAsync(uint itemEffectId);
Task<SimcRawTrait> GetTraitDataAsync(int traitEntryId);
Task<List<SimcRawTrait>> GetTraitsByClassSpecAsync(int classId, int specId);
Expand Down
1 change: 0 additions & 1 deletion SimcProfileParser/Model/DataSync/SimcFileTypeEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public enum SimcParsedFileType
SpellScaleMultipliers,
CurvePoints,
RppmData,
CovenantData,
ItemEffectData,
GameDataVersion,
TraitData
Expand Down
10 changes: 0 additions & 10 deletions SimcProfileParser/Model/Generated/SimcSpell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,12 @@ public class SimcSpell
/// Just getting percent mana is fine for our purposes now.
/// </summary>
public Dictionary<uint, double> PowerCosts { get; internal set; }

/// <summary>
/// Set if this spell is a conduit
/// </summary>
public uint ConduitId { get; set; }
/// <summary>
/// Contains each of the ranks stored as N-1 (0-indexed). Entry [0] is Rank 1.
/// </summary>
public Dictionary<uint, double> ConduitRanks { get; set; }
public List<SimcSpellRppmModifier> RppmModifiers { get; internal set; }

public SimcSpell()
{
Effects = new List<SimcSpellEffect>();
RppmModifiers = new List<SimcSpellRppmModifier>();
ConduitRanks = new Dictionary<uint, double>();
PowerCosts = new Dictionary<uint, double>();
}
}
Expand Down
13 changes: 0 additions & 13 deletions SimcProfileParser/Model/Profile/SimcParsedConduit.cs

This file was deleted.

10 changes: 0 additions & 10 deletions SimcProfileParser/Model/Profile/SimcParsedProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ public class SimcParsedProfile
public string Race { get; internal set; }
public int RaceId { get; internal set; }
public string Role { get; internal set; }

public string Covenant { get; internal set; }
public IReadOnlyList<SimcParsedSoulbind> Soulbinds { get; internal set; }
/// <summary>
/// Available conduits
/// </summary>
public IReadOnlyList<SimcParsedConduit> Conduits { get; internal set; }
/// <summary>
/// Covenant Renown level
/// </summary>
Expand All @@ -57,9 +50,6 @@ public SimcParsedProfile()
Professions = new List<SimcParsedProfession>();
Talents = new List<SimcParsedTalent>();

Soulbinds = new List<SimcParsedSoulbind>();
Conduits = new List<SimcParsedConduit>();

ProfileLines = new List<SimcParsedLine>();
}
}
Expand Down
20 changes: 0 additions & 20 deletions SimcProfileParser/Model/Profile/SimcParsedSoulbind.cs

This file was deleted.

Loading