<commit_before>﻿using System;
using System.IO;
using System.Xml.Linq;
using TCC.Data;
using TCC.Data.Databases;

namespace TCC.ViewModels
{
    public class PriestBarManager : ClassManager
    {
        private static PriestBarManager _instance;
        public static PriestBarManager Instance => _instance ?? (_instance = new PriestBarManager());

        public DurationCooldownIndicator EnergyStars { get; private set; }
        public DurationCooldownIndicator Grace { get; private set; }

        public PriestBarManager() : base()
        {
            _instance = this;
            CurrentClassManager = this;
            LoadSpecialSkills();
        }
        protected override void LoadSpecialSkills()
        {
            //Energy Stars
            EnergyStars = new DurationCooldownIndicator(_dispatcher);
            SkillsDatabase.TryGetSkill(350410, Class.Priest, out Skill es);
            EnergyStars.Cooldown = new FixedSkillCooldown(es, CooldownType.Skill, _dispatcher, true);
            EnergyStars.Buff = new FixedSkillCooldown(es, CooldownType.Skill, _dispatcher, false);

            Grace = new DurationCooldownIndicator(_dispatcher);
            SkillsDatabase.TryGetSkill(390100, Class.Priest, out Skill gr);
            Grace.Cooldown = new FixedSkillCooldown(gr, CooldownType.Skill, _dispatcher, true);
            Grace.Buff = new FixedSkillCooldown(gr, CooldownType.Skill, _dispatcher, false);

        }

        public override bool StartSpecialSkill(SkillCooldown sk)
        {
            if(sk.Skill.IconName == EnergyStars.Cooldown.Skill.IconName)
            {
                EnergyStars.Cooldown.Start(sk.Cooldown);
                return true;
            }
            if (sk.Skill.IconName == Grace.Cooldown.Skill.IconName)
            {
                Grace.Cooldown.Start(sk.Cooldown);
                return true;<commit_msg>disabled grace flashing if effect is still on<commit_after>﻿using System;
using System.IO;
using System.Xml.Linq;
using TCC.Data;
using TCC.Data.Databases;

namespace TCC.ViewModels
{
    public class PriestBarManager : ClassManager
    {
        private static PriestBarManager _instance;
        public static PriestBarManager Instance => _instance ?? (_instance = new PriestBarManager());

        public DurationCooldownIndicator EnergyStars { get; private set; }
        public DurationCooldownIndicator Grace { get; private set; }

        public PriestBarManager() : base()
        {
            _instance = this;
            CurrentClassManager = this;
            LoadSpecialSkills();
            Grace.Buff.PropertyChanged += GracePropertyChanged;
        }

        private void GracePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(Grace.Buff.IsAvailable))
            {
                Grace.Cooldown.FlashOnAvailable = Grace.Buff.IsAvailable;
            }
        }

        protected override void LoadSpecialSkills()
        {
            //Energy Stars
            EnergyStars = new DurationCooldownIndicator(_dispatcher);
            SkillsDatabase.TryGetSkill(350410, Class.Priest, out Skill es);
            EnergyStars.Cooldown = new FixedSkillCooldown(es, CooldownType.Skill, _dispatcher, true);
            EnergyStars.Buff = new FixedSkillCooldown(es, CooldownType.Skill, _dispatcher, false);

            Grace = new DurationCooldownIndicator(_dispatcher);
            SkillsDatabase.TryGetSkill(390100, Class.Priest, out Skill gr);
            Grace.Cooldown = new FixedSkillCooldown(gr, CooldownType.Skill, _dispatcher, false);
            Grace.Buff = new FixedSkillCooldown(gr, CooldownType.Skill, _dispatcher, false);

        }

        public override bool StartSpecialSkill(SkillCooldown sk)
        {
            if(sk.Skill.IconName == EnergyStars.Cooldown.Skill.IconName)
            {
                EnergyStars.Cooldown.Start(sk.Cooldown);
                return true;
            }
            if (sk.Skill.IconName == Grace.Cooldown.Skill.IconName)
            {
                Grace.Cooldown.Start(sk.Cooldown);
                return true;
{'fraction_non_alphanumeric': 0.08140096618357488, 'fraction_numerical': 0.005797101449275362, 'mean_word_length': 2.3530364372469634, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1687585', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1153, 'n_words': 239}