public NewDawnBattlefieldObjective GetClosestFlag(Point3D destPos, bool inPlay = false)
        {
            _logger.Trace(".");
            NewDawnBattlefieldObjective bestFlag = null;
            ulong bestDist = 0;

            foreach (NewDawnBattlefieldObjective flag in Objectives)
            {
                ulong curDist = flag.GetDistanceSquare(destPos);

                if (bestFlag == null || (curDist < bestDist && (!inPlay || flag.FlagState != ObjectiveFlags.ZoneLocked)))
                {
                    bestFlag = flag;
                    bestDist = flag.GetDistanceSquare(destPos);
                }
            }

            return(bestFlag);
        }
        /// <summary>
        /// Loads battlefront objectives.
        /// </summary>

        private void LoadObjectives()
        {
            List <Battlefront_Objective> objectives = BattlefrontService.GetBattlefrontObjectives(Region.RegionId);

            if (objectives == null)
            {
                return; // t1 or database lack
            }
            float orderDistanceSum  = 0f;
            float destroDistanceSum = 0f;

            foreach (Battlefront_Objective obj in objectives)
            {
                NewDawnBattlefieldObjective flag = new NewDawnBattlefieldObjective(obj, Region.GetTier());
                Objectives.Add(flag);
                Region.AddObject(flag, obj.ZoneId);
                flag.Battlefront = this;

                //orderDistanceSum += flag.GetWarcampDistance(Realms.REALMS_REALM_ORDER);
                //destroDistanceSum += flag.GetWarcampDistance(Realms.REALMS_REALM_DESTRUCTION);
            }
        }