\b;Instruction \c;radar\n;
With the instruction \c;radar();\n;, you can look for objects like \l;enemies\u object\mother;, bots, buildings or raw materials.

\b;Utilisation courante
Donnez entre parenthèses le \l;nom de l'objet\u cbot\category; que vous cherchez. Mettez le résultat dans une variable de \l;type\u cbot\type; \c;object\n;. Voici par exemple comment chercher la fourmi la plus proche:
\c;
\s;// Tout au début du programme:
\s;object  chose; // déclaration de la variable
\s;
\s;// Cherche la fourmi la plus proche
\s;chose = radar(AlienAnt);
\n;
\b;Pour spécialistes
Syntaxe:
\s;\c;radar ( cat, angle, focus, min, max, sens, filter );\n;

Détecte un objet selon divers critères.

\image radar1 8 8;
La zone arrondie violette correspond, vue d'en haut, à la zone dans laquelle les objets sont détectés.

\t;cat: \c;\l;int\u cbot\int;\n;
o \l;Category\u cbot\category; of the objects that should be detected. For example, when you are looking for an ant, write \c;radar(AlienAnt)\n;. 
o \l;Array\u cbot\array; of categories of the objects that should be detected. For example, when you are looking only for grabbers:
\c;\s;int bots[4];
\s;bots[0] = WheeledGrabber;
\s;bots[1] = TrackedGrabber;
\s;bots[2] = WingedGrabber;
\s;bots[3] = LeggedGrabber;
\s;object nearestGrabber = radar(bots);\n;
o Keyword \const;Any\norm; if you are looking for any object (including even plants and so on). Filters may be useful to use with this keyword.

\t;angle: \c;\l;float\u cbot\float;\n; (default value: \c;0\n;)
Direction dans laquelle est dirigé le radar, en degrés.
\c;  0\n; -> radar dirigé droit devant
\c;-90\n; -> radar dirigé à gauche
\c; 90\n; -> radar dirigé à droite

\t;focus: \c;\l;float\u cbot\float;\n; (default value: \c;360\n;)
Angle d'ouverture du radar, en degrés.

\t;min: \c;\l;float\u cbot\float;\n; (default value: \c;0\n;)
Distance minimale de détection, en mètres. Avant cette distance, les objets sont ignorés.

\t;max: \c;\l;float\u cbot\float;\n; (default value: \c;1000\n;)
Distance maximale de détection, en mètres. Au delà de cette distance, les objets sont ignorés.

\t;sens: \c;\l;float\u cbot\float;\n; (default value: \c;1\n;)
Sens dans lequel s'effectue la recherche. Avec la valeur \c;1\n;, on cherche de l'intérieur vers l'extérieur. Autrement dit, c'est l'objet le plus proche qui est trouvé. Avec \c;-1\n;, on cherche de l'extérieur vers l'intérieur. On trouvera donc l'objet le plus éloigné.

\t;filter: \c;\l;int\u cbot\int;\n; (default value: \c;\const;FilterNone\norm;\n;)
Determines which type of objects should be detected. Especially useful in use with an \l;array\u cbot\array; or \const;Any\norm;. The following filters are available:

\c;\const;FilterNone\norm;        \n;Detects everything (default)
\c;\const;FilterOnlyLanding\norm; \n;Detects only objects being on the ground
\c;\const;FilterOnlyFlying\norm;  \n;Detects only objects not being on the ground
\c;\const;FilterFriendly\norm;    \n;Detects only allies (objects in the same team)
\c;\const;FilterEnemy\norm;       \n;Detects only enemies (objects in an other team except neutral)
\c;\const;FilterNeutral\norm;     \n;Detects only neutral objects (e.g. resources)

The last three are mainly useful in \l;code battles\u battles;. You can also pass a team ID to search only for objects from a specific team. Attention: you should use \const;FilterNeutral\norm; instead of \c;0\n; or else it will not work.

Filters and IDs can be mixed using bitwise OR operator \c;|\n;, for example \c;radar(Any, 0, 360, 0, 1000, 1, 2 | FilterOnlyLanding);\n; will only detect an object from team \c;2\n; that is on the ground. Attention: you can specify only one team ID at once, but you can specify several filters at once.

\t;Valeur retournée: \c;\l;object\u cbot\object;\n;
Objet trouvé le plus proche. La valeur \c;\l;null\u cbot\null;\n; indique que rien n'a été trouvé.

\t;Remarque
Il n'est pas nécessaire de donner tous les paramètres. Voici deux exemples identiques:
\c;
\s;	radar(Titanium, 0, 360, 0, 1000);
\s;	radar(Titanium);  // identique

\s;	radar(Titanium, 0, 90, 0, 1000);
\s;	radar(Titanium, 0, 90);  // identique
\n;
En fait, lorsque des paramètres manquent, ils prennent les valeurs par défaut indiquées plus haut. Le premier paramètre \c;catégorie\n; est obligatoire. Les cinq paramètres suivants sont facultatifs, et sont remplacés par \c;0\n;, \c;360\n;, \c;0\n;, \c;1000\n; et \c;1\n; s'ils manquent.
Ceci est très utile. En effet, \c;radar(XXX)\n; trouve l'objet le plus proche, où qu'il soit.

\t;Voir aussi
\c;\l;radarall\u cbot\radarall;();\n;, \l;programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.

