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; } }
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); } } } }
public abstract void UpdateBallPass(RobotControls controls);
public abstract void UpdateMovement(RobotControls controls);
public abstract void UpdateAttack(RobotControls controls);
public abstract void UpdateData(RobotControls controls);