コード例 #1
0
        public void Update(Dictionary <long, Dictionary <DamageMeter.Skills.Skill.Skill, SkillStats> > timedSkills,
                           Dictionary <long, Dictionary <DamageMeter.Skills.Skill.Skill, SkillStats> > timedAllSkills,
                           PlayerInfo playerinfo, PlayerAbnormals buffs, Entity currentBoss, bool timedEncounter, long firstHit, long lastHit)
        {
            var lastTick  = (lastHit + 1) * TimeSpan.TicksPerSecond - 1;
            var firstTick = firstHit * TimeSpan.TicksPerSecond;
            var death     = buffs.Death;

            if (death == null)
            {
                DeathCounter.Content  = 0;
                DeathDuration.Content = "0s";
            }
            else
            {
                DeathCounter.Content = death.Count(firstTick, lastTick);
                var duration = death.Duration(firstTick, lastTick);
                var interval = TimeSpan.FromTicks(duration);
                DeathDuration.Content = interval.ToString(@"mm\:ss");
            }
            var aggro = buffs.Aggro(currentBoss?.NpcE);

            if (aggro == null)
            {
                AggroCounter.Content  = 0;
                AggroDuration.Content = "0s";
            }
            else
            {
                AggroCounter.Content = aggro.Count(firstTick, lastTick);
                var duration = aggro.Duration(firstTick, lastTick);
                var interval = TimeSpan.FromTicks(duration);
                AggroDuration.Content = interval.ToString(@"mm\:ss");
            }

            var skills    = NoTimedSkills(timedSkills);
            var allSkills = NoTimedSkills(timedAllSkills);

            if (_skillDps == null)
            {
                _skillDps  = new SkillsDetail(skills, SkillsDetail.Type.Dps, currentBoss, timedEncounter);
                _skillHeal = new SkillsDetail(allSkills, SkillsDetail.Type.Heal, currentBoss, timedEncounter);
                _skillMana = new SkillsDetail(allSkills, SkillsDetail.Type.Mana, currentBoss, timedEncounter);
                _buff      = new Buff(playerinfo, buffs, currentBoss);
            }
            else
            {
                _skillDps.Update(skills, currentBoss, timedEncounter);
                _skillHeal.Update(new Dictionary <DamageMeter.Skills.Skill.Skill, SkillStats>(allSkills), currentBoss, timedEncounter);
                _skillMana.Update(new Dictionary <DamageMeter.Skills.Skill.Skill, SkillStats>(allSkills), currentBoss, timedEncounter);
                _buff.Update(playerinfo, buffs, currentBoss);
            }
            HealPanel.Content = _skillHeal;
            DpsPanel.Content  = _skillDps;
            ManaPanel.Content = _skillMana;
            BuffPanel.Content = _buff;
        }
コード例 #2
0
        public void Update(PlayerDamageDealt playerDamageDealt, EntityInformation entityInformation,
                           Database.Structures.Skills skills, PlayerAbnormals buffs, bool timedEncounter)
        {
            if (_skills == null || skills != null)
            {
                _skills = skills;
                var death = buffs.Death;
                if (death == null)
                {
                    DeathCounter.Content  = 0;
                    DeathDuration.Content = "0" + LP.Seconds;
                }
                else
                {
                    DeathCounter.Content = death.Count(entityInformation.BeginTime, entityInformation.EndTime);
                    var duration = death.Duration(entityInformation.BeginTime, entityInformation.EndTime);
                    var interval = TimeSpan.FromTicks(duration);
                    DeathDuration.Content = interval.ToString(@"mm\:ss");
                }
                var aggro = buffs.Aggro(entityInformation.Entity);
                if (aggro == null)
                {
                    AggroCounter.Content  = 0;
                    AggroDuration.Content = "0" + LP.Seconds;
                }
                else
                {
                    AggroCounter.Content = aggro.Count(entityInformation.BeginTime, entityInformation.EndTime);
                    var duration = aggro.Duration(entityInformation.BeginTime, entityInformation.EndTime);
                    var interval = TimeSpan.FromTicks(duration);
                    AggroDuration.Content = interval.ToString(@"mm\:ss");
                }

                //return;

                //var tabItem = (TabItem) TabControl.SelectedItem;
                //if (tabItem == null)
                //{
                //    TabControl.SelectedIndex = 0;
                //    tabItem = (TabItem) TabControl.SelectedItem;
                //}
                //switch (tabItem.Name)
                //{
                //    case "DpsPanel":
                //        if (_skillDps == null)
                //        {
                _skillDps =
                    new SkillsDetail(
                        SkillAggregate.GetAggregate(playerDamageDealt, entityInformation.Entity, _skills,
                                                    timedEncounter,
                                                    Database.Database.Type.Damage), Database.Database.Type.Damage);
                //}
                DpsPanel.Content = _skillDps;
                //    return;
                //case "HealPanel":
                //    if (_skillHeal == null)
                //    {
                _skillHeal =
                    new SkillsDetail(
                        SkillAggregate.GetAggregate(playerDamageDealt, entityInformation.Entity, _skills,
                                                    timedEncounter,
                                                    Database.Database.Type.Heal), Database.Database.Type.Heal);
                //    }
                HealPanel.Content = _skillHeal;
                //    return;
                //case "ManaPanel":
                //    if (_skillMana == null)
                //    {
                _skillMana =
                    new SkillsDetail(
                        SkillAggregate.GetAggregate(playerDamageDealt, entityInformation.Entity, _skills,
                                                    timedEncounter,
                                                    Database.Database.Type.Mana), Database.Database.Type.Mana);
                //    }
                ManaPanel.Content = _skillMana;
                //    return;
                //case "BuffPanel":
                //    if (_buff == null)
                //    {
                _buff = new Buff(playerDamageDealt, buffs, entityInformation);
                //    }
                BuffPanel.Content = _buff;
                //    return;
                //case "SkillsDealtPanel":
                //    if (_skillDealtLog == null)
                //    {
                _skillDealtLog =
                    new SkillsLog(
                        _skills?.GetSkillsDealt(playerDamageDealt.Source.User, entityInformation.Entity,
                                                timedEncounter), false);
                //    }
                SkillsDealtPanel.Content = _skillDealtLog;
                //    return;
                //case "SkillsReceivedPanel":
                //    if (_skillReceivedLog == null)
                //    {
                _skillReceivedLog =
                    new SkillsLog(
                        _skills?.GetSkillsReceived(playerDamageDealt.Source.User, timedEncounter), true);
                //    }
                SkillsReceivedPanel.Content = _skillReceivedLog;
                //return;
            }
        }
コード例 #3
0
ファイル: Skills.xaml.cs プロジェクト: neowutran/ShinraMeter
        public void Update(PlayerDamageDealt playerDamageDealt, EntityInformation entityInformation,
            Database.Structures.Skills skills, PlayerAbnormals buffs, bool timedEncounter)
        {
            if (_skills == null || skills != null)
            {
                _skills = skills;
                var death = buffs.Death;
                if (death == null)
                {
                    DeathCounter.Content = 0;
                    DeathDuration.Content = "0" + LP.Seconds;
                }
                else
                {
                    DeathCounter.Content = death.Count(entityInformation.BeginTime, entityInformation.EndTime);
                    var duration = death.Duration(entityInformation.BeginTime, entityInformation.EndTime);
                    var interval = TimeSpan.FromTicks(duration);
                    DeathDuration.Content = interval.ToString(@"mm\:ss");
                }
                var aggro = buffs.Aggro(entityInformation.Entity);
                if (aggro == null)
                {
                    AggroCounter.Content = 0;
                    AggroDuration.Content = "0" + LP.Seconds;
                }
                else
                {
                    AggroCounter.Content = aggro.Count(entityInformation.BeginTime, entityInformation.EndTime);
                    var duration = aggro.Duration(entityInformation.BeginTime, entityInformation.EndTime);
                    var interval = TimeSpan.FromTicks(duration);
                    AggroDuration.Content = interval.ToString(@"mm\:ss");
                }

                //return;

                //var tabItem = (TabItem) TabControl.SelectedItem;
                //if (tabItem == null)
                //{
                //    TabControl.SelectedIndex = 0;
                //    tabItem = (TabItem) TabControl.SelectedItem;
                //}
                //switch (tabItem.Name)
                //{
                //    case "DpsPanel":
                //        if (_skillDps == null)
                //        {
                _skillDps =
                    new SkillsDetail(
                        SkillAggregate.GetAggregate(playerDamageDealt, entityInformation.Entity, _skills,
                            timedEncounter,
                            Database.Database.Type.Damage), Database.Database.Type.Damage);
                //}
                DpsPanel.Content = _skillDps;
                //    return;
                //case "HealPanel":
                //    if (_skillHeal == null)
                //    {
                _skillHeal =
                    new SkillsDetail(
                        SkillAggregate.GetAggregate(playerDamageDealt, entityInformation.Entity, _skills,
                            timedEncounter,
                            Database.Database.Type.Heal), Database.Database.Type.Heal);
                //    }
                HealPanel.Content = _skillHeal;
                //    return;
                //case "ManaPanel":
                //    if (_skillMana == null)
                //    {
                _skillMana =
                    new SkillsDetail(
                        SkillAggregate.GetAggregate(playerDamageDealt, entityInformation.Entity, _skills,
                            timedEncounter,
                            Database.Database.Type.Mana), Database.Database.Type.Mana);
                //    }
                ManaPanel.Content = _skillMana;
                //    return;
                //case "BuffPanel":
                //    if (_buff == null)
                //    {
                _buff = new Buff(playerDamageDealt, buffs, entityInformation);
                //    }
                BuffPanel.Content = _buff;
                //    return;
                //case "SkillsDealtPanel":
                //    if (_skillDealtLog == null)
                //    {
                _skillDealtLog =
                    new SkillsLog(
                        _skills?.GetSkillsDealt(playerDamageDealt.Source.User, entityInformation.Entity,
                            timedEncounter), false);
                //    }
                SkillsDealtPanel.Content = _skillDealtLog;
                //    return;
                //case "SkillsReceivedPanel":
                //    if (_skillReceivedLog == null)
                //    {
                _skillReceivedLog =
                    new SkillsLog(
                        _skills?.GetSkillsReceived(playerDamageDealt.Source.User, timedEncounter), true);
                //    }
                SkillsReceivedPanel.Content = _skillReceivedLog;
                //return;
            }
        }