/// <summary>
 /// Mets à jour les positions
 /// </summary>
 private void _updateLocation()
 {
     UdpAdapter udpa = new UdpAdapter();
     Protocol_handler ph = new Protocol_handler();
     List<Sprite> entityList;
     List<Sprite> resources;
     udpa.send(ph.Unit_getAll());
     ph.Entity_receivelist((Byte[])udpa.receive(), out entityList);
     udpa.send(ph.Ressources_getAll());
     ph.Entity_receivelist((Byte[])udpa.receive(), out resources);
     entityList.AddRange(resources);
     List<Drawable> dl = this._pool.getEntities();
     for (int i = 0; i < entityList.Count(); ++i)
     {
         int j = 0;
         for (; j < dl.Count() ; ++j)
         {
             if (dl[j].getId() == entityList[i].getId())
             {
                 Point real_loc = PointConverter.ToClientPoint(new Point((int)entityList[i].ServerLoc.X, (int)entityList[i].ServerLoc.Y));
                 dl[j].Location = new Point((int)entityList[i].ServerLoc.X, (int)entityList[i].ServerLoc.Y);
                 dl[j].Position = new Vector2((float)-real_loc.X, (float)-real_loc.Y);
                 break;
             }
         }
         if (j >= dl.Count())
         {
             this._pool.loadEntity(entityList[i]);
         }
     }
     for (int i = 0; i < dl.Count(); ++i)
     {
         int j = 0;
         for (; j < entityList.Count(); ++j)
         {
             if (dl[i].getId() == entityList[j].getId())
             {
                 break;
             }
         }
         if (j >= entityList.Count())
         {
             this._pool.getEntities().RemoveAt(i);
         }
     }
 }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Protocol_handler protocol = new Protocol_handler();
            UdpAdapter udpa = new UdpAdapter();
            udpa.send(protocol.Unit_getAll());
            List<Sprite> entityList;
            protocol.Entity_receivelist((Byte[])udpa.receive(), out entityList);
            List<Sprite> resources;
            udpa.send(protocol.Ressources_getAll());
            protocol.Entity_receivelist((Byte[])udpa.receive(), out resources);
            entityList.AddRange(resources);
            // Chargement de la map
            Sprite map = new Sprite(new Vector2(0, 0), null);
            map.setPath("map");
            // Chargement du HUD
            Sprite hud = new Sprite(new Vector2(0, 289), null);
            hud.setPath("hud");
            // Chargement des boutons
            List<Sprite> buttonList = new List<Sprite>();

            // TODO: use this.Content to load your game content here
            _graphics.loadGame(entityList, map, hud, this._playerinfo, buttonList, out this._pool);
        }