示例#1
0
        protected void UpdateClosestEnemy(RobotControls controls)
        {
            SubjectiveRobot?closestEnemy;

            closestEnemy = null;
            float distanceMin = 1000f;

            if (visibleEnemies.Count > 0)
            {
                foreach (SubjectiveRobot robot in visibleEnemies)
                {
                    if (Vector3.Distance(robot.currentPosition, controls.myself.currentPosition) < distanceMin)
                    {
                        distanceMin  = Vector3.Distance(robot.currentPosition, controls.myself.currentPosition);
                        closestEnemy = robot;
                    }
                }
            }

            if (closestEnemy.HasValue)
            {
                _closestEnemy   = closestEnemy.Value;
                _noClosestEnemy = false;
            }
            else
            {
                _noClosestEnemy = true;
            }
        }
示例#2
0
 protected void CheckForVisibility(RobotControls controls)
 {
     visibleEnemies.Clear();
     visibleTeamMates.Clear();
     foreach (SubjectiveRobot robot in controls.archiveRobots)
     {
         if (robot.isSeen)
         {
             if (robot.team == controls.myself.team && robot.id != controls.myself.id)
             {
                 visibleTeamMates.Add(robot);
             }
             else
             {
                 visibleEnemies.Add(robot);
             }
         }
     }
 }
示例#3
0
 public abstract void UpdateBallPass(RobotControls controls);
示例#4
0
 public abstract void UpdateMovement(RobotControls controls);
示例#5
0
 public abstract void UpdateAttack(RobotControls controls);
示例#6
0
 public abstract void UpdateData(RobotControls controls);