Exemple #1
0
 public bool IsOverlapping(InstanceClearInfo _ClearInfo)
 {
     if ((_ClearInfo.ClearStartDateTime > ClearStartDateTime &&
          _ClearInfo.ClearStartDateTime < ClearEndDateTime) ||
         (ClearStartDateTime > _ClearInfo.ClearStartDateTime &&
          ClearStartDateTime < _ClearInfo.ClearEndDateTime))
     {
         return(false);
     }
     return(true);
 }
Exemple #2
0
 public void Update(GroupRaidCollection _GroupRC)
 {
     foreach (var raid in _GroupRC.Raids)
     {
         Dictionary <string, string[]> instanceRuns;
         if (BossInformation.InstanceRuns.TryGetValue(raid.Value.RaidInstance, out instanceRuns) == false)
         {
             continue;
         }
         foreach (var instanceRun in instanceRuns)
         {
             var instanceClearData = VF_RaidDamageDatabase.RaidInstanceClearData.Generate(raid, instanceRun.Value);
             if (instanceClearData != null)
             {
                 InstanceClearInfo instanceClearInfo = new InstanceClearInfo
                 {
                     ClearStartDateTime = instanceClearData.m_RaidStartClearTime,
                     ClearEndDateTime   = instanceClearData.m_RaidEndClearTime
                 };
                 bool foundDuplicate = false;
                 if (FastestInstanceClears.ContainsKey(instanceRun.Key) == true)
                 {
                     var fastestClears = FastestInstanceClears[instanceRun.Key];
                     for (int i = 0; i < fastestClears.Count; ++i)
                     {
                         if (fastestClears[i].IsOverlapping(instanceClearInfo) == true)
                         {
                             fastestClears[i] = instanceClearInfo;
                             foundDuplicate   = true;
                         }
                     }
                 }
                 if (foundDuplicate == false)
                 {
                     FastestInstanceClears.AddToList(instanceRun.Key, instanceClearInfo);
                 }
             }
         }
         foreach (var bossFight in raid.Value.BossFights)
         {
             if (bossFight.IsQualityHigh(true) == true && bossFight.AttemptType == AttemptType.KillAttempt)
             {
                 var bossKillInfo = new BossKillInfo
                 {
                     KillStartDateTime = bossFight.StartDateTime,
                     KillEndDateTime   = bossFight.EndDateTime,
                 };
                 bool foundDuplicate = false;
                 if (FastestBossKills.ContainsKey(bossFight.BossName) == true)
                 {
                     var fastestKills = FastestBossKills[bossFight.BossName];
                     for (int i = 0; i < fastestKills.Count; ++i)
                     {
                         if (fastestKills[i].IsOverlapping(bossKillInfo) == true)
                         {
                             fastestKills[i] = bossKillInfo;
                             foundDuplicate  = true;
                         }
                     }
                 }
                 if (foundDuplicate == false)
                 {
                     FastestBossKills.AddToList(bossFight.BossName, bossKillInfo);
                 }
             }
         }
     }
     foreach (var fastestClears in FastestInstanceClears)
     {
         fastestClears.Value.Sort((x, y) => x.GetClearTimeSeconds() - y.GetClearTimeSeconds());
     }
     foreach (var fastestKills in FastestBossKills)
     {
         fastestKills.Value.Sort((x, y) => x.GetKillTimeSeconds() - y.GetKillTimeSeconds());
     }
 }