Пример #1
0
        /// <summary>
        ///   Does the work.
        /// </summary>
        /// <param name="myMe">My me.</param>
        /// <param name="myEVE">My eve.</param>
        private void DoWork(Character myMe, EVE.ISXEVE.EVE myEVE)
        {
            if (CurrentBotState == BotState.Active)
            {
                try
                {
                    var allEntities = EntityRepository.GetLocalGridEntities(myMe, myEVE).ToArray();

                    var engageableTargets = CombatHelper.FindEngageableTargets(myMe, myEVE, allEntities, EngageRules).ToList();

                    Entities = new ObservableCollection <EntityViewModel>(allEntities);

                    foreach (var engageableTarget in engageableTargets)
                    {
                        logger.Log(engageableTarget.EntityName + " " + " Corp: " + engageableTarget.Entity.Owner.Corp.Name + " " + engageableTarget.Entity.Owner.Corp.ID +
                                   " AllyId: " + engageableTarget.Entity.Owner.AllianceID + " isFleet" + engageableTarget.Entity.FleetTag);
                    }

                    CombatHelper.Engage(myMe, myEVE, engageableTargets, EngageRules);
                }

                catch (Exception exc)
                {
                    InnerSpace.Echo("DO WORK ERROR: " + exc.Message);
                }
            }
        }