public bool IsBetterVersionOf(BossFight _BossFight) { try { var aQualityHigh = IsQualityHigh(); var aFightStart = m_StartDateTime; var aFightEnd = m_EndDateTime; var aFightDuration = m_FightDuration; var bQualityHigh = _BossFight.IsQualityHigh(); var bFightStart = _BossFight.m_StartDateTime; var bFightEnd = _BossFight.m_EndDateTime; var bFightDuration = _BossFight.m_FightDuration; if (aQualityHigh == true && bQualityHigh == false) { return(true); } else if (aQualityHigh == false && bQualityHigh == true) { return(false); } var aEndSpecifier = m_DataPrecisionDetails.EndSpecifier; var bEndSpecifier = _BossFight.m_DataPrecisionDetails.EndSpecifier; if (aEndSpecifier == SpecifierType.CombatEventSpecifier || aEndSpecifier == SpecifierType.YellSpecifier) { if (bEndSpecifier != SpecifierType.CombatEventSpecifier && bEndSpecifier != SpecifierType.YellSpecifier) { return(true); } } else if (bEndSpecifier == SpecifierType.CombatEventSpecifier || bEndSpecifier == SpecifierType.YellSpecifier) { if (aEndSpecifier != SpecifierType.CombatEventSpecifier && aEndSpecifier != SpecifierType.YellSpecifier) { return(true);/*if statement not needed but here for clarity*/ } } if (m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.Damage) + m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.EffectiveHeal) + m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.DamageTaken) > _BossFight.m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.Damage) + _BossFight.m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.EffectiveHeal) + _BossFight.m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.DamageTaken)) { return(true); } else { return(false); } } catch (Exception ex) { VF_RaidDamageDatabase.Logger.LogException(ex); } return(false); }
public bool IsOverlapping(BossFight _BossFight) { if (m_BossName != _BossFight.m_BossName) { return(false); } var aFightStart = m_StartDateTime; var aFightEnd = m_EndDateTime; var bFightStart = _BossFight.m_StartDateTime; var bFightEnd = _BossFight.m_EndDateTime; return((aFightStart >= bFightStart && aFightStart <= bFightEnd) || (aFightEnd >= bFightStart && aFightEnd <= bFightEnd) || (bFightStart >= aFightStart && bFightStart <= aFightEnd) || (bFightEnd >= aFightStart && bFightEnd <= aFightEnd)); }
public void AddBossFightData(BossFight _BossFight, PlayerFightData _PlayerFightData) { if (_BossFight.IsQualityHigh(true)) { if (m_PlayerBossStats.ContainsKey(_BossFight.BossName) == false) { m_PlayerBossStats.Add(_BossFight.BossName, new TotalPlayerBossStats()); } var bossFightDataList = m_PlayerBossStats[_BossFight.BossName]; bossFightDataList.m_PlayerFightDatas.Add(_PlayerFightData); } m_AttendedFights.Add(_BossFight); }
public bool IsBetterVersionOf(BossFight _BossFight) { try { var aQualityHigh = IsQualityHigh(); var aFightStart = m_StartDateTime; var aFightEnd = m_EndDateTime; var aFightDuration = m_FightDuration; var bQualityHigh = _BossFight.IsQualityHigh(); var bFightStart = _BossFight.m_StartDateTime; var bFightEnd = _BossFight.m_EndDateTime; var bFightDuration = _BossFight.m_FightDuration; if (aQualityHigh == true && bQualityHigh == false) { return(true); } else if (aQualityHigh == false && bQualityHigh == true) { return(false); } if (m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.Damage) + m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.EffectiveHeal) + m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.DamageTaken) > _BossFight.m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.Damage) + _BossFight.m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.EffectiveHeal) + _BossFight.m_PlayerFightData.Sum((_Value) => (long)_Value.Item2.DamageTaken)) { return(true); } else { return(false); } } catch (Exception ex) { VF_RaidDamageDatabase.Logger.LogException(ex); } return(false); }
public void Update(Old_RaidCollection_Raid _Raid, List <Old_RaidBossFight> _RaidBossFights) { if (m_UniqueRaidID != _Raid.UniqueRaidID || m_RaidID != _Raid.RaidID || m_RaidResetDateTime != _Raid.RaidResetDateTime) { throw new Exception("Update(RaidCollection_Raid _Raid): _Raid did not match!"); } if (_Raid.RaidStartDate < m_RaidStartDate) { m_RaidStartDate = _Raid.RaidStartDate; } if (_Raid.RaidEndDate > m_RaidEndDate) { m_RaidEndDate = _Raid.RaidEndDate; } foreach (var bossFight in _RaidBossFights) { try { m_RaidMembers.AddRangeUnique(bossFight.GetFightCacheData().m_FightDataCollection.m_RaidMembers); } catch (Exception) {} } foreach (var bossFight in _RaidBossFights) { if (bossFight.GetBossName() == "Trash") { continue;//Skip trash for obvious reasons } try { BossFight newBossFight = new BossFight(new Old_RaidBossFight[] { bossFight }, m_RaidMembers); if (newBossFight == null) { throw new Exception("Crazy BossFight Crash Exception"); } newBossFight.InitCache(this); int overlappingFightIndex = m_BossFights.FindIndex((_Value) => _Value.IsOverlapping(newBossFight)); if (overlappingFightIndex != -1) { //Overlapping fights if (newBossFight.IsBetterVersionOf(m_BossFights[overlappingFightIndex]) == true) { m_BossFights[overlappingFightIndex] = newBossFight; } } else { m_BossFights.Add(newBossFight); } } catch (Exception ex) { if (ex.Message.StartsWith("Player:") && ex.Message.EndsWith("was not found in unitDatas")) { VF_RaidDamageDatabase.Logger.ConsoleWriteLine("Exception in RaidID: " + m_RaidID + ", BossFight: " + bossFight.GetBossName() + ", Message: \"" + ex.Message + "\"", ConsoleColor.Red); } else { VF_RaidDamageDatabase.Logger.LogException(ex); } } } }
public void Dispose() { m_CacheBossFight = null; }
public void InitCache(BossFight _BossFight) { m_CacheBossFight = _BossFight; }