<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>API &mdash; Prologin Serveur 2015</title>
    
    <link rel="stylesheet" href="_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/translations.js"></script>
    <link rel="top" title="Prologin Serveur 2015" href="index.html" />
    <link rel="next" title="Consignes de rendu" href="rendu.html" />
    <link rel="prev" title="Stechec 2 : le système de lancement de matchs" href="stechec2.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="Index général"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="rendu.html" title="Consignes de rendu"
             accesskey="N">suivant</a> |</li>
        <li class="right" >
          <a href="stechec2.html" title="Stechec 2 : le système de lancement de matchs"
             accesskey="P">précédent</a> |</li>
        <li><a href="index.html">Prologin Serveur 2015</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="api">
<h1>API<a class="headerlink" href="#api" title="Lien permanent vers ce titre">¶</a></h1>
<div class="section" id="constantes">
<h2>Constantes<a class="headerlink" href="#constantes" title="Lien permanent vers ce titre">¶</a></h2>
<dl class="var">
<dt id="c.TAILLE_TERRAIN">
<tt class="descname">TAILLE_TERRAIN</tt><a class="headerlink" href="#c.TAILLE_TERRAIN" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">30</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Taille du terrain (longueur et largeur).</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.NB_TOURS">
<tt class="descname">NB_TOURS</tt><a class="headerlink" href="#c.NB_TOURS" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">100</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de tours à jouer avant la fin de la partie.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.NB_POINTS_DEPLACEMENT">
<tt class="descname">NB_POINTS_DEPLACEMENT</tt><a class="headerlink" href="#c.NB_POINTS_DEPLACEMENT" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">6</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de points de déplacement par tour (avant utilisation du turbo).</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.NB_POINTS_ACTION">
<tt class="descname">NB_POINTS_ACTION</tt><a class="headerlink" href="#c.NB_POINTS_ACTION" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">42</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de points d&#8217;action par tour.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.COUT_CAPTURE">
<tt class="descname">COUT_CAPTURE</tt><a class="headerlink" href="#c.COUT_CAPTURE" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">3</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de points d&#8217;action que coûte la capture d&#8217;un portail.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.COUT_LIEN">
<tt class="descname">COUT_LIEN</tt><a class="headerlink" href="#c.COUT_LIEN" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">2</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de points d&#8217;action que coûte la création d&#8217;un lien.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.COUT_NEUTRALISATION">
<tt class="descname">COUT_NEUTRALISATION</tt><a class="headerlink" href="#c.COUT_NEUTRALISATION" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">10</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de points d&#8217;action que coûte la neutralisation d&#8217;un portail de base.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.COUT_NEUTRALISATION_BOUCLIER">
<tt class="descname">COUT_NEUTRALISATION_BOUCLIER</tt><a class="headerlink" href="#c.COUT_NEUTRALISATION_BOUCLIER" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">5</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de points d&#8217;action supplémentaires que coûte la neutralisation pour chaque bouclier présent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.COUT_BOUCLIER">
<tt class="descname">COUT_BOUCLIER</tt><a class="headerlink" href="#c.COUT_BOUCLIER" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">3</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de points d&#8217;action que coûte la mise en place d&#8217;un bouclier sur un portail sans bouclier.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.COUT_TURBO">
<tt class="descname">COUT_TURBO</tt><a class="headerlink" href="#c.COUT_TURBO" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">6</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de points d&#8217;action que coûte l&#8217;utilisation d&#8217;un turbo.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.MAX_BOUCLIERS">
<tt class="descname">MAX_BOUCLIERS</tt><a class="headerlink" href="#c.MAX_BOUCLIERS" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">6</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre maximum de boucliers sur un même portail.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.POINTS_CAPTURE">
<tt class="descname">POINTS_CAPTURE</tt><a class="headerlink" href="#c.POINTS_CAPTURE" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">10</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Nombre de points que rapporte la capture d&#8217;un portail.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="var">
<dt id="c.POINTS_CHAMP">
<tt class="descname">POINTS_CHAMP</tt><a class="headerlink" href="#c.POINTS_CHAMP" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Valeur:</th><td class="field-body">2</td>
</tr>
<tr class="field-even field"><th class="field-name">Description:</th><td class="field-body">Constante de proportionnalité reliant l&#8217;aire d&#8217;un champ au nombre de points qu&#8217;il rapporte par tour.</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="enumerations">
<h2>Énumérations<a class="headerlink" href="#enumerations" title="Lien permanent vers ce titre">¶</a></h2>
<dl class="type">
<dt id="c.erreur">
<tt class="descname">erreur</tt><a class="headerlink" href="#c.erreur" title="Permalien vers cette définition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Description:</th><td class="field-body"><p class="first">Erreurs possibles</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Valeurs:</th><td class="field-body"><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">OK:</th><td class="field-body">L&#8217;action a été exécutée avec succès</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">PA_INSUFFISANTS:</th></tr>
<tr class="field-even field"><td>&nbsp;</td><td class="field-body">Vous ne possédez pas assez de points d&#8217;action pour cette action.</td>
</tr>
<tr class="field-odd field"><th class="field-name">AUCUN_PORTAIL:</th><td class="field-body">La position spécifiée n&#8217;est pas un portail.</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">POSITION_INVALIDE:</th></tr>
<tr class="field-even field"><td>&nbsp;</td><td class="field-body">La position spécifiée est hors de la carte.</td>
</tr>
<tr class="field-odd field"><th class="field-name" colspan="2">POSITION_ELOIGNEE:</th></tr>
<tr class="field-odd field"><td>&nbsp;</td><td class="field-body">La destination est trop éloignée.</td>
</tr>
<tr class="field-even field"><th class="field-name">PORTAIL_AMI:</th><td class="field-body">Le portail vous appartient.</td>
</tr>
<tr class="field-odd field"><th class="field-name">PORTAIL_NEUTRE:</th><td class="field-body">Le portail est neutre.</td>
</tr>
<tr class="field-even field"><th class="field-name">PORTAIL_ENNEMI:</th><td class="field-body">Le portail appartient à votre adversaire.</td>
</tr>
<tr class="field-odd field"><th class="field-name" colspan="2">LIEN_INTERSECTION:</th></tr>
<tr class="field-odd field"><td>&nbsp;</td><td class="field-body">Le lien croise un lien existant.</td>
</tr>
<tr class="field-even field"><th class="field-name">LIEN_CHAMP:</th><td class="field-body">Le lien se trouve dans un champ existant.</td>
</tr>
<tr class="field-odd field"><th class="field-name">LIEN_DEGENERE:</th><td class="field-body">Les deux extrémités du lien coïncident.</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">LIMITE_BOUCLIERS:</th></tr>
<tr class="field-even field"><td>&nbsp;</td><td class="field-body">Ce portail est équipé du nombre maximal de boucliers.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="structures">
<h2>Structures<a class="headerlink" href="#structures" title="Lien permanent vers ce titre">¶</a></h2>
<dl class="type">
<dt id="c.position">
<tt class="descname">position</tt><a class="headerlink" href="#c.position" title="Permalien vers cette définition">¶</a></dt>
<dd><div class="highlight-c"><div class="highlight"><pre><span class="k">struct</span> <span class="n">position</span> <span class="p">{</span>
    <span class="kt">int</span> <span class="n">x</span><span class="p">;</span>
    <span class="kt">int</span> <span class="n">y</span><span class="p">;</span>
<span class="p">};</span>
</pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Description:</th><td class="field-body"><p class="first">Position sur la carte, donnée par deux coordonnées.</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Champs:</th><td class="field-body"><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">x:</th><td class="field-body">Coordonnée en X</td>
</tr>
<tr class="field-even field"><th class="field-name">y:</th><td class="field-body">Coordonnée en Y</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="type">
<dt id="c.lien">
<tt class="descname">lien</tt><a class="headerlink" href="#c.lien" title="Permalien vers cette définition">¶</a></dt>
<dd><div class="highlight-c"><div class="highlight"><pre><span class="k">struct</span> <span class="n">lien</span> <span class="p">{</span>
    <span class="n">position</span> <span class="n">extr1</span><span class="p">;</span>
    <span class="n">position</span> <span class="n">extr2</span><span class="p">;</span>
    <span class="kt">int</span> <span class="n">joueur_l</span><span class="p">;</span>
<span class="p">};</span>
</pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Description:</th><td class="field-body"><p class="first">Représente un lien existant.</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Champs:</th><td class="field-body"><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">extr1:</th><td class="field-body">Première extrémité du lien.</td>
</tr>
<tr class="field-even field"><th class="field-name">extr2:</th><td class="field-body">Seconde extrémité du lien.</td>
</tr>
<tr class="field-odd field"><th class="field-name">joueur_l:</th><td class="field-body">Joueur possédant ce lien.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="type">
<dt id="c.champ">
<tt class="descname">champ</tt><a class="headerlink" href="#c.champ" title="Permalien vers cette définition">¶</a></dt>
<dd><div class="highlight-c"><div class="highlight"><pre><span class="k">struct</span> <span class="n">champ</span> <span class="p">{</span>
    <span class="n">position</span> <span class="n">som1</span><span class="p">;</span>
    <span class="n">position</span> <span class="n">som2</span><span class="p">;</span>
    <span class="n">position</span> <span class="n">som3</span><span class="p">;</span>
    <span class="kt">int</span> <span class="n">joueur_c</span><span class="p">;</span>
<span class="p">};</span>
</pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Description:</th><td class="field-body"><p class="first">Représente un champ de contrôle existant.</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Champs:</th><td class="field-body"><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">som1:</th><td class="field-body">Premier sommet du champ.</td>
</tr>
<tr class="field-even field"><th class="field-name">som2:</th><td class="field-body">Deuxième sommet du champ.</td>
</tr>
<tr class="field-odd field"><th class="field-name">som3:</th><td class="field-body">Troisième sommet du champ.</td>
</tr>
<tr class="field-even field"><th class="field-name">joueur_c:</th><td class="field-body">Joueur possédant ce champ.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="fonctions">
<h2>Fonctions<a class="headerlink" href="#fonctions" title="Lien permanent vers ce titre">¶</a></h2>
<dl class="function">
<dt id="c.deplacer">
<a class="reference internal" href="#c.erreur" title="erreur">erreur</a> <tt class="descname">deplacer</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;dest</em><big>)</big><a class="headerlink" href="#c.deplacer" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Déplace votre agent sur la case passée en argument.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>dest</strong> &#8211; Case de destination.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.utiliser_turbo">
<a class="reference internal" href="#c.erreur" title="erreur">erreur</a> <tt class="descname">utiliser_turbo</tt><big>(</big><big>)</big><a class="headerlink" href="#c.utiliser_turbo" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Utilise un turbo.</p>
</dd></dl>

<dl class="function">
<dt id="c.capturer">
<a class="reference internal" href="#c.erreur" title="erreur">erreur</a> <tt class="descname">capturer</tt><big>(</big><big>)</big><a class="headerlink" href="#c.capturer" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Capture le portail où est positionné votre agent.</p>
</dd></dl>

<dl class="function">
<dt id="c.lier">
<a class="reference internal" href="#c.erreur" title="erreur">erreur</a> <tt class="descname">lier</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;portail</em><big>)</big><a class="headerlink" href="#c.lier" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Crée un lien entre le portail où se trouve votre agent et le portail de destination donné en argument.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>portail</strong> &#8211; Portail de destination du lien.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.neutraliser">
<a class="reference internal" href="#c.erreur" title="erreur">erreur</a> <tt class="descname">neutraliser</tt><big>(</big><big>)</big><a class="headerlink" href="#c.neutraliser" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Neutralise le portail où se trouve votre agent.</p>
</dd></dl>

<dl class="function">
<dt id="c.ajouter_bouclier">
<a class="reference internal" href="#c.erreur" title="erreur">erreur</a> <tt class="descname">ajouter_bouclier</tt><big>(</big><big>)</big><a class="headerlink" href="#c.ajouter_bouclier" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Ajoute un bouclier au portail sur lequel se trouve votre agent.</p>
</dd></dl>

<dl class="function">
<dt id="c.liste_liens">
<a class="reference internal" href="#c.lien" title="lien">lien</a> array <tt class="descname">liste_liens</tt><big>(</big><big>)</big><a class="headerlink" href="#c.liste_liens" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste de tous les liens présents.</p>
</dd></dl>

<dl class="function">
<dt id="c.liste_champs">
<a class="reference internal" href="#c.champ" title="champ">champ</a> array <tt class="descname">liste_champs</tt><big>(</big><big>)</big><a class="headerlink" href="#c.liste_champs" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste de tous les champs de contrôle.</p>
</dd></dl>

<dl class="function">
<dt id="c.liste_portails">
<a class="reference internal" href="#c.position" title="position">position</a> array <tt class="descname">liste_portails</tt><big>(</big><big>)</big><a class="headerlink" href="#c.liste_portails" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste de tous les portails de la carte.</p>
</dd></dl>

<dl class="function">
<dt id="c.liens_bloquants">
<a class="reference internal" href="#c.lien" title="lien">lien</a> array <tt class="descname">liens_bloquants</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;ext1</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;ext2</em><big>)</big><a class="headerlink" href="#c.liens_bloquants" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste de tous les liens existants qui croisent un segment, entravant la création d&#8217;un lien.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>ext1</strong> &#8211; Première extrémité du segment.</li>
<li><strong>ext2</strong> &#8211; Seconde extrémité du segment.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.lien_existe">
bool <tt class="descname">lien_existe</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;ext1</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;ext2</em><big>)</big><a class="headerlink" href="#c.lien_existe" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Prend les positions de deux portails, et renvoie un booléen indiquant s&#8217;ils sont reliés. Le résultat est <cite>false</cite> lorsque l&#8217;une des deux positions ne repère pas un portail.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>ext1</strong> &#8211; Premier portail.</li>
<li><strong>ext2</strong> &#8211; Second portail.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.champ_existe">
bool <tt class="descname">champ_existe</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;som1</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;som2</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;som3</em><big>)</big><a class="headerlink" href="#c.champ_existe" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie un booléen indiquant si les 3 positions repèrent bien 3 portails tous reliés entre eux.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>som1</strong> &#8211; Premier portail.</li>
<li><strong>som2</strong> &#8211; Deuxième portail.</li>
<li><strong>som3</strong> &#8211; Troisième portail.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.case_dans_champ">
bool <tt class="descname">case_dans_champ</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;pos</em><big>)</big><a class="headerlink" href="#c.case_dans_champ" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie un booléen indiquant si la case <tt class="docutils literal"><span class="pre">pos</span></tt> se trouve dans un champ.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>pos</strong> &#8211; Position de la case.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.case_champs">
<a class="reference internal" href="#c.champ" title="champ">champ</a> array <tt class="descname">case_champs</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;pos</em><big>)</big><a class="headerlink" href="#c.case_champs" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste des champs à l&#8217;intérieur desquels <tt class="docutils literal"><span class="pre">pos</span></tt> se trouve. Si la case est un portail, le résultat de <tt class="docutils literal"><span class="pre">case_champs</span></tt> sera disjoint de celui de <tt class="docutils literal"><span class="pre">champs_incidents_portail</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>pos</strong> &#8211; Position de la case.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.portail_joueur">
int <tt class="descname">portail_joueur</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;portail</em><big>)</big><a class="headerlink" href="#c.portail_joueur" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie le numéro du joueur correspondant au portail donné, -1 si le portail est neutre, -2 si la case n&#8217;est pas un portail. Vous pouvez utiliser cette fonction pour vérifier qu&#8217;une case donnée est bien un portail.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>portail</strong> &#8211; Position du portail.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.portail_boucliers">
int <tt class="descname">portail_boucliers</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;portail</em><big>)</big><a class="headerlink" href="#c.portail_boucliers" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie le nombre de boucliers présents sur un portail (-2 si la case n&#8217;est pas un portail).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>portail</strong> &#8211; Position du portail.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.liens_incidents_portail">
<a class="reference internal" href="#c.lien" title="lien">lien</a> array <tt class="descname">liens_incidents_portail</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;portail</em><big>)</big><a class="headerlink" href="#c.liens_incidents_portail" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste de tous les liens dont le portail donné est une extrémité.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>portail</strong> &#8211; Position du portail.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.champs_incidents_portail">
<a class="reference internal" href="#c.champ" title="champ">champ</a> array <tt class="descname">champs_incidents_portail</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;portail</em><big>)</big><a class="headerlink" href="#c.champs_incidents_portail" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste de tous les champs dont le portail donné est un sommet.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>portail</strong> &#8211; Position du portail.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.champs_incidents_segment">
<a class="reference internal" href="#c.champ" title="champ">champ</a> array <tt class="descname">champs_incidents_segment</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;ext1</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;ext2</em><big>)</big><a class="headerlink" href="#c.champs_incidents_segment" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste de tous les champs dont le lien donné est un côté. Si le segment n&#8217;est pas un lien présent, renvoie la liste de tous les champs que la création du lien ferait apparaître.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>ext1</strong> &#8211; Première extrémité du segment.</li>
<li><strong>ext2</strong> &#8211; Seconde extrémité du segment.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.hist_portails_captures">
<a class="reference internal" href="#c.position" title="position">position</a> array <tt class="descname">hist_portails_captures</tt><big>(</big><big>)</big><a class="headerlink" href="#c.hist_portails_captures" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste des portails capturés par votre adversaire au dernier tour.</p>
</dd></dl>

<dl class="function">
<dt id="c.hist_portails_neutralises">
<a class="reference internal" href="#c.position" title="position">position</a> array <tt class="descname">hist_portails_neutralises</tt><big>(</big><big>)</big><a class="headerlink" href="#c.hist_portails_neutralises" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste des portails neutralisés par votre adversaire au dernier tour.</p>
</dd></dl>

<dl class="function">
<dt id="c.hist_liens_crees">
<a class="reference internal" href="#c.lien" title="lien">lien</a> array <tt class="descname">hist_liens_crees</tt><big>(</big><big>)</big><a class="headerlink" href="#c.hist_liens_crees" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste des liens créés par votre adversaire au dernier tour.</p>
</dd></dl>

<dl class="function">
<dt id="c.hist_champs_crees">
<a class="reference internal" href="#c.champ" title="champ">champ</a> array <tt class="descname">hist_champs_crees</tt><big>(</big><big>)</big><a class="headerlink" href="#c.hist_champs_crees" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste des champs créés par votre adversaire au dernier tour.</p>
</dd></dl>

<dl class="function">
<dt id="c.hist_boucliers_ajoutes">
<a class="reference internal" href="#c.position" title="position">position</a> array <tt class="descname">hist_boucliers_ajoutes</tt><big>(</big><big>)</big><a class="headerlink" href="#c.hist_boucliers_ajoutes" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la liste des positions où votre adversaire a ajouté des boucliers au dernier tour.</p>
</dd></dl>

<dl class="function">
<dt id="c.distance">
int <tt class="descname">distance</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;pos1</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;pos2</em><big>)</big><a class="headerlink" href="#c.distance" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie la distance de Manhattan entre deux positions.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>pos1</strong> &#8211; Première position</li>
<li><strong>pos2</strong> &#8211; Seconde position</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.score_triangle">
int <tt class="descname">score_triangle</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;som1</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;som2</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;som3</em><big>)</big><a class="headerlink" href="#c.score_triangle" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie le nombre de points que rapporte(rait) chaque tour un champ existant ou hypothétique.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>som1</strong> &#8211; Premier sommet du triangle.</li>
<li><strong>som2</strong> &#8211; Deuxième sommet du triangle.</li>
<li><strong>som3</strong> &#8211; Troisième sommet du triangle.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.intersection_segments">
bool <tt class="descname">intersection_segments</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;a1</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;a2</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;b1</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;b2</em><big>)</big><a class="headerlink" href="#c.intersection_segments" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Indique si deux segments se croisent. Cette fonction correspond exactement à la condition d&#8217;interférence entre liens, c&#8217;est-à-dire qu&#8217;elle renvoie <tt class="docutils literal"><span class="pre">false</span></tt> si l&#8217;intersection est une extrémité des deux segments.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>a1</strong> &#8211; Première extrémité du premier segment.</li>
<li><strong>a2</strong> &#8211; Seconde extrémité du premier segment.</li>
<li><strong>b1</strong> &#8211; Première extrémité du second segment.</li>
<li><strong>b2</strong> &#8211; Seconde extrémité du second segment.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.point_dans_triangle">
bool <tt class="descname">point_dans_triangle</tt><big>(</big><a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;p</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;som1</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;som2</em>, <a class="reference internal" href="#c.position" title="position">position</a><em>&nbsp;som3</em><big>)</big><a class="headerlink" href="#c.point_dans_triangle" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Indique si un point se trouve à l&#8217;intérieur d&#8217;un triangle. Le critère coïncide avec celui de <tt class="docutils literal"><span class="pre">case_champs</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>p</strong> &#8211; Point à tester.</li>
<li><strong>som1</strong> &#8211; Premier sommet du triangle.</li>
<li><strong>som2</strong> &#8211; Deuxième sommet du triangle.</li>
<li><strong>som3</strong> &#8211; Troisième sommet du triangle.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.moi">
int <tt class="descname">moi</tt><big>(</big><big>)</big><a class="headerlink" href="#c.moi" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie votre numéro de joueur.</p>
</dd></dl>

<dl class="function">
<dt id="c.adversaire">
int <tt class="descname">adversaire</tt><big>(</big><big>)</big><a class="headerlink" href="#c.adversaire" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie le numéro de votre adversaire.</p>
</dd></dl>

<dl class="function">
<dt id="c.position_agent">
<a class="reference internal" href="#c.position" title="position">position</a> <tt class="descname">position_agent</tt><big>(</big>int<em>&nbsp;id_joueur</em><big>)</big><a class="headerlink" href="#c.position_agent" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Indique la position de l&#8217;agent du joueur désigné par le numéro <tt class="docutils literal"><span class="pre">id_joueur</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>id_joueur</strong> &#8211; Numéro du joueur.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.points_action">
int <tt class="descname">points_action</tt><big>(</big><big>)</big><a class="headerlink" href="#c.points_action" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Indique votre nombre de points d&#8217;actions restants pour ce tour-ci.</p>
</dd></dl>

<dl class="function">
<dt id="c.points_deplacement">
int <tt class="descname">points_deplacement</tt><big>(</big><big>)</big><a class="headerlink" href="#c.points_deplacement" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Indique votre nombre de points de déplacement restants pour ce tour-ci.</p>
</dd></dl>

<dl class="function">
<dt id="c.score">
int <tt class="descname">score</tt><big>(</big>int<em>&nbsp;id_joueur</em><big>)</big><a class="headerlink" href="#c.score" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie le score du joueur désigné par le numéro <tt class="docutils literal"><span class="pre">id_joueur</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple">
<li><strong>id_joueur</strong> &#8211; Identifiant du joueur</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="c.tour_actuel">
int <tt class="descname">tour_actuel</tt><big>(</big><big>)</big><a class="headerlink" href="#c.tour_actuel" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Renvoie le numéro du tour actuel.</p>
</dd></dl>

<dl class="function">
<dt id="c.annuler">
bool <tt class="descname">annuler</tt><big>(</big><big>)</big><a class="headerlink" href="#c.annuler" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Annule la dernière action. Renvoie <tt class="docutils literal"><span class="pre">false</span></tt> quand il n&#8217;y a pas d&#8217;action à annuler ce tour-ci.</p>
</dd></dl>

</div>
<div class="section" id="fonctions-utilisateur">
<h2>Fonctions utilisateur<a class="headerlink" href="#fonctions-utilisateur" title="Lien permanent vers ce titre">¶</a></h2>
<dl class="function">
<dt id="c.partie_init">
void <tt class="descname">partie_init</tt><big>(</big><big>)</big><a class="headerlink" href="#c.partie_init" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Fonction appelée au début de la partie.</p>
</dd></dl>

<dl class="function">
<dt id="c.jouer_tour">
void <tt class="descname">jouer_tour</tt><big>(</big><big>)</big><a class="headerlink" href="#c.jouer_tour" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Fonction appelée à chaque tour.</p>
</dd></dl>

<dl class="function">
<dt id="c.partie_fin">
void <tt class="descname">partie_fin</tt><big>(</big><big>)</big><a class="headerlink" href="#c.partie_fin" title="Permalien vers cette définition">¶</a></dt>
<dd><p>Fonction appelée à la fin de la partie.</p>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table des Matières</a></h3>
  <ul>
<li><a class="reference internal" href="#">API</a><ul>
<li><a class="reference internal" href="#constantes">Constantes</a></li>
<li><a class="reference internal" href="#enumerations">Énumérations</a></li>
<li><a class="reference internal" href="#structures">Structures</a></li>
<li><a class="reference internal" href="#fonctions">Fonctions</a></li>
<li><a class="reference internal" href="#fonctions-utilisateur">Fonctions utilisateur</a></li>
</ul>
</li>
</ul>

  <h4>Sujet précédent</h4>
  <p class="topless"><a href="stechec2.html"
                        title="Chapitre précédent">Stechec 2 : le système de lancement de matchs</a></p>
  <h4>Sujet suivant</h4>
  <p class="topless"><a href="rendu.html"
                        title="Chapitre suivant">Consignes de rendu</a></p>
  <h3>Cette page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/api.txt"
           rel="nofollow">Montrer la source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Recherche rapide</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Saisissez un mot clef ou un nom de module, classe ou fonction.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="Index général"
             >index</a></li>
        <li class="right" >
          <a href="rendu.html" title="Consignes de rendu"
             >suivant</a> |</li>
        <li class="right" >
          <a href="stechec2.html" title="Stechec 2 : le système de lancement de matchs"
             >précédent</a> |</li>
        <li><a href="index.html">Prologin Serveur 2015</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2015, Prologin.
      Créé avec <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>