public static void TryApply(this OnHitStatus onHitStatus, SavingThrow savingThrow, PlayableEntity applicant, PlayableEntity target)
        {
            if (onHitStatus.HasApplyCondition)
            {
                ICustomConsole      console            = DIContainer.GetImplementation <ICustomConsole>();
                IFontColorProvider  colorProvider      = DIContainer.GetImplementation <IFontColorProvider>();
                IFontWeightProvider fontWeightProvider = DIContainer.GetImplementation <IFontWeightProvider>();

                // there is a saving throw to resist the status
                Characteristic charac = target.Characteristics.GetCharacteristic(onHitStatus.ApplySavingCharacteristic);

                console.AddEntry(target.DisplayName, fontWeightProvider.Bold);
                console.AddEntry(" tries to restist the ");
                console.AddEntry(onHitStatus.Header, fontWeightProvider.Bold);
                console.AddEntry(" status from ");
                console.AddEntry(applicant.DisplayName, fontWeightProvider.Bold);
                console.AddEntry(". ");
                console.AddEntry($"{savingThrow.Result}/{savingThrow.Difficulty}", fontWeightProvider.Bold);
                console.AddEntry(" ==> ");

                if (savingThrow.Result >= savingThrow.Difficulty)
                {
                    //resist
                    console.AddEntry("Success\r\n", fontWeightProvider.Bold);
                    //applyStatus(false);
                }
                else
                {
                    //fails
                    console.AddEntry("Failure\r\n", fontWeightProvider.Bold);
                    //applyStatus();
                }
            }
        }
        public MainWindow()
        {
            // this lines serves the purpose of force loading its .dll, enabling the mediator to find the handler.
            GetInputDamageResultListHandler handler = new GetInputDamageResultListHandler();


            OnHitStatus.RegisterEvents   = OnHitStatusGameExtension.Register;
            OnHitStatus.UnregisterEvents = OnHitStatusGameExtension.Unregister;

            Logger.Init();

            DIConfigurer.ConfigureCore();
            DIConfigurer.ConfigureWpf();
            DIConfigurer.Verify();

            GlobalContext.Context.CharacterList             = SaveManager.LoadGenericList <Character, CharacterList>(SaveManager.players_folder);
            GlobalContext.Context.MonsterList               = SaveManager.LoadGenericList <Monster, MonsterList>(SaveManager.monsters_folder);
            GlobalContext.Context.SpellList                 = SaveManager.LoadGenericList <Spell, SpellList>(SaveManager.spells_folder);
            GlobalContext.Context.SpellList.IsMainSpellList = true;

            Global.Loading = false;

            console = DIContainer.GetImplementation <ICustomConsole>();

            GlobalContext.Context.FightContext.FightersList.Elements.CollectionChanged += FightingCharacters_CollectionChanged;

            DataContext = GlobalContext.Context;

            InitializeComponent();

            Loaded += MainWindow_Loaded;
        }
        public static void ConfigureWpf()
        {
            // REGISTER

            // Console
            DIContainer.RegisterSingleton <ICustomConsole, WpfConsole>();
            DIContainer.RegisterSingleton <IFontColorProvider, WpfFontColorProvider>();
            DIContainer.RegisterSingleton <IFontWeightProvider, WpfFontWeightProvider>();

            // CONFIGURE

            // WpfConsole
            ICustomConsole console = DIContainer.GetImplementation <ICustomConsole>();

            console.DefaultFontColor = new WpfFontColor()
            {
                Brush = Application.Current.Resources["Light"] as SolidColorBrush
            };
            // FontColorProvider
            IFontColorProvider colorProvider = DIContainer.GetImplementation <IFontColorProvider>();

            colorProvider.SetDefault(new WpfFontColor()
            {
                Brush = Application.Current.Resources["Light"] as SolidColorBrush
            });
            colorProvider.AddKey("Light", new WpfFontColor()
            {
                Brush = Application.Current.Resources["Light"] as SolidColorBrush
            });
            colorProvider.AddKey("Acid", new WpfFontColor()
            {
                Brush = new SolidColorBrush(Colors.YellowGreen)
            });
            colorProvider.AddKey("Cold", new WpfFontColor()
            {
                Brush = new SolidColorBrush(Colors.Aqua)
            });
            colorProvider.AddKey("Fire", new WpfFontColor()
            {
                Brush = new SolidColorBrush(Colors.Red)
            });
            colorProvider.AddKey("Lightning", new WpfFontColor()
            {
                Brush = new SolidColorBrush(Colors.Yellow)
            });
            colorProvider.AddKey("Necrotic", new WpfFontColor()
            {
                Brush = new SolidColorBrush(Colors.Black)
            });
            colorProvider.AddKey("Poison", new WpfFontColor()
            {
                Brush = new SolidColorBrush(Colors.Green)
            });
            colorProvider.AddKey("Psychic", new WpfFontColor()
            {
                Brush = new SolidColorBrush(Colors.Purple)
            });
            colorProvider.AddKey("Radiant", new WpfFontColor()
            {
                Brush = new SolidColorBrush(Colors.Orange)
            });
        }