Beispiel #1
0
        public void Observe()
        {
            List <IEyeableInfo> eyeableInfo = orderServer.GetEyeableInfo();

            if (eyeableInfo.Count != 0)
            {
                IEyeableInfo first = eyeableInfo[0];
                if (first is TankSinTur.TankCommonEyeableInfo)
                {
                    TankSinTur.TankCommonEyeableInfo enemyInfo = (TankSinTur.TankCommonEyeableInfo)first;
                    enemyPos = enemyInfo.Pos;
                    float Distance = Vector2.Distance(enemyPos, orderServer.Pos);

                    Vector2 curPos   = orderServer.Pos;
                    Vector2 enemyVec = Vector2.Normalize(curPos - enemyPos);
                    Vector2 curDir   = orderServer.Direction;

                    Vector2 lineVec = new Vector2(enemyVec.Y, -enemyVec.X);
                    if (Vector2.Dot(lineVec, curDir) < 0)
                    {
                        lineVec = -lineVec;
                    }
                    if (Distance > maxGuardFactor * raderRadius || Distance < minGuardFactor * raderRadius ||
                        Vector2.Dot(curDir, lineVec) < 0.8)
                    {
                        curPriority = ConsiderPriority.Urgency;
                        return;
                    }
                }
            }

            curPriority = ConsiderPriority.Vacancy;
        }
Beispiel #2
0
        public void Observe()
        {
            List <IEyeableInfo> eyeableInfo = orderServer.GetEyeableInfo();

            if (eyeableInfo.Count == 0)
            {
                curPriority = ConsiderPriority.Low;
            }


            Point curGrid = FindCurGrid();

            if (curGrid != LastGrid)
            {
                LastGrid = curGrid;
                UpdateCurGridTime(curGrid);
                enterNewGrid = true;
            }
        }
Beispiel #3
0
        public void Observe()
        {
            List <IEyeableInfo> eyeableInfo = orderServer.GetEyeableInfo();

            if (eyeableInfo.Count == 0)
            {
                curPriority = ConsiderPriority.Low;
            }
            else
            {
                curPriority = ConsiderPriority.Vacancy;
            }
        }
Beispiel #4
0
        public void Observe()
        {
            List <IEyeableInfo> eyeableInfo = orderServer.GetEyeableInfo();

            if (eyeableInfo.Count != 0)
            {
                curPriority = ConsiderPriority.High;
                IEyeableInfo first = eyeableInfo[0];
                if (first is TankSinTur.TankCommonEyeableInfo)
                {
                    TankSinTur.TankCommonEyeableInfo enemyInfo = (TankSinTur.TankCommonEyeableInfo)first;
                    enemyPos = enemyInfo.Pos;
                }
            }
            else
            {
                curPriority = ConsiderPriority.Vacancy;
            }
        }
Beispiel #5
0
        public void Observe()
        {
            List <IEyeableInfo> eyeableInfo = orderServer.GetEyeableInfo();

            if (eyeableInfo.Count != 0)
            {
                IEyeableInfo first = eyeableInfo[0];
                if (first is TankSinTur.TankCommonEyeableInfo)
                {
                    enemyInfo = (TankSinTur.TankCommonEyeableInfo)first;
                    float selfToEnemyAzi = MathTools.AziFromRefPos(orderServer.Pos - enemyInfo.Pos);
                    float enemyTurretAzi = enemyInfo.TurretAimAzi;
                    if (Math.Abs(MathTools.AngTransInPI(enemyTurretAzi - selfToEnemyAzi)) < guardAng)
                    {
                        curPriority = ConsiderPriority.High;
                        return;
                    }
                }
            }

            curPriority = ConsiderPriority.Vacancy;
        }