Пример #1
0
        private void Initialize(MapEvent battle, PartyBase attackerParty, PartyBase defenderParty)
        {
            if (SimulationModel.IsValidEventType(battle.EventType))
            {
                var simulationModel = new SimulationModel(battle, attackerParty, defenderParty);

                if (!simulationModel.IsPlayerInvolved && !Config.CurrentConfig.EnabledForAI)
                {
                    return;
                }

                if (SimulationsPool.AddModelToSimulations(simulationModel))
                {
                    if (simulationModel.IsPlayerInvolved)
                    {
                        if (Config.CurrentConfig.ShouldLogThis(simulationModel.IsPlayerInvolved))
                        {
                            MessageHelper.DisplayText($"Initialized {simulationModel.EventDescription}", DisplayTextStyle.Info);
                        }
                    }
                    else
                    {
                        // battle observer for battles started by AI
                        battle.AddSimulationObserver();
                    }
                }
            }
        }