public InGame(Rectangle windowSize, KeyboardState keyboardState, MouseState mouseState)
        {
            StopAllConnections();
            _animDone = false;
            this._windowSize = windowSize;
            _dashing = _waitingDash = false;
            _dashTimer = 0;
            this._mouseState = mouseState;
            this._keyboardState = keyboardState;
            this._originalWindowSize = windowSize;
            this._menu = new ContextMenu(this._windowSize, new AnimatedSprite(new Rectangle(0, 30, 200, 50), this._windowSize, "game/menu/container", 1, 1, 30, 1, -1, -1, false), "menu/contextMenuExit", (byte)235);
            this._menu.Title = new AnimatedSprite(new Rectangle(this._menu.Position.Width / 2 - 75, 0, 150, 50), this._windowSize, "menu/contextMenuText", 1, 1, 30, 1, -1, -1, false);
            this._menu.Visible = false;
            this._menu.Add(new AnimatedSprite(new Rectangle(this._menu.Position.Width / 2 - 100, 65, 200, 22), this._windowSize, "menu/contextMenuTextMainMenu", 1, 1, 30, 1, -1, -1, false));
            this._menu.Add(new TextSprite("SpriteFont1", _windowSize, new Rectangle(0, 0, 200, 22), Color.Red, INFO.ENG ? "Start Network" : "Demarrer le reseau"));
            this._menu.Add(new TextSprite("SpriteFont1", _windowSize, new Rectangle(0, 0, 200, 22), Color.Red, INFO.ENG ? "Connection" : "Connexion"));
            this._menu.Add(new TextSprite("SpriteFont1", _windowSize, new Rectangle(0, 0, 200, 22), Color.Red, INFO.ENG ? "Disconnect" : "Déconnexion"));
            this._menu.CuadricPositionning(new Rectangle(0, 0, 150, 20), 65, 15, 10, 10, true);
            this.mouse = new Sprite(new Rectangle(-100, -100, 30, 50), this._windowSize, "");
            this._maps = new List<AbstractMap>();
            AbstractMap abstractMap1 = new AbstractMap(this._windowSize);
            abstractMap1.AddVisitable(450, 450, 2800, 130);
            abstractMap1.VuePosition = new Vector2(460f, 579f);
            abstractMap1.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, this._windowSize.Width, this._windowSize.Height), windowSize, "map1/sky1", 1, 1, 30, 1, -1, -1, false), 0.2f, 0.0f, true, false, false, true, false));
            abstractMap1.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 190, 960, 300), windowSize, "map1/back1r", 1, 1, 30, 1, -1, -1, false), 0.8f, 0.2f, true, false, false, true, false));
            abstractMap1.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 415, 1082, 193), windowSize, "map1/fore1", 1, 1, 30, 1, -1, -1, false), 1f, 0.5f, true, false, false, true, false));
            abstractMap1.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(400, 450, 150, 150), this._windowSize, "game/heal_font_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, false, false, true));
            abstractMap1.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(5, 150, this._windowSize.Width / 2, this._windowSize.Height - 150), this._windowSize, "sprites/fireWall_11x6r23r44", 11, 6, 30, 23, 44, 1, true), 1f, 0.5f, false, false, false, true, false));
            abstractMap1.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(2550 + this._windowSize.Width / 2, 280, 320, 320), this._windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, true, false));

            AbstractMap abstractMap3 = new AbstractMap(this._windowSize);
            abstractMap3.AddVisitable(450, 450, 2800, 130);
            abstractMap3.VuePosition = new Vector2(460f, 579f);
            abstractMap3.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, 1800, 600), windowSize, "map3/back", 1, 1, 30, 1, -1, -1, false), 1f, 0.5f, true, false, false, true, false));
            abstractMap3.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(200, 50, 300, 233), windowSize, "map3/chandelier_sprite", 8, 4, 30, 1, 32, 1, true), 1f, 0.5f, false, true, false, true, false));
            abstractMap3.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(800, 50, 300, 233), windowSize, "map3/chandelier_sprite", 8, 4, 30, 1, 32, 1, true), 1f, 0.5f, false, true, false, true, false));
            abstractMap3.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(1400, 50, 300, 233), windowSize, "map3/chandelier_sprite", 8, 4, 30, 1, 32, 1, true), 1f, 0.5f, false, true, false, true, false));
            abstractMap3.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(2000, 50, 300, 233), windowSize, "map3/chandelier_sprite", 8, 4, 30, 1, 32, 1, true), 1f, 0.5f, false, true, false, true, false));
            abstractMap3.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 500, 1042, 159), windowSize, "map3/ground", 1, 1, 30, 1, -1, -1, false), 1f, 0.5f, true, false, false, true, false));
            abstractMap3.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(250, 280, 320, 320), this._windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, false, false));
            abstractMap3.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(3050, 280, 320, 320), this._windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, true, false));

            AbstractMap abstractMap4 = new AbstractMap(this._windowSize);
            abstractMap4.AddVisitable(450, 450, 2000, 130);
            abstractMap4.VuePosition = new Vector2(460f, 579f);
            abstractMap4.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, 1800, 600), windowSize, "map3/back", 1, 1, 30, 1, -1, -1, false), 1f, 0.5f, true, false, false, true, false));
            abstractMap4.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(200, 50, 300, 233), windowSize, "map3/chandelier_sprite", 8, 4, 30, 1, 32, 1, true), 1f, 0.5f, false, true, false, true, false));
            abstractMap4.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(800, 50, 300, 233), windowSize, "map3/chandelier_sprite", 8, 4, 30, 1, 32, 1, true), 1f, 0.5f, false, true, false, true, false));
            abstractMap4.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(1400, 50, 300, 233), windowSize, "map3/chandelier_sprite", 8, 4, 30, 1, 32, 1, true), 1f, 0.5f, false, true, false, true, false));
            abstractMap4.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 500, 1042, 159), windowSize, "map3/ground", 1, 1, 30, 1, -1, -1, false), 1f, 0.5f, true, false, false, true, false));
            abstractMap4.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(250, 280, 320, 320), this._windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, false, false));
            abstractMap4.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(1750+500, 280, 320, 320), this._windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, true, false));

            AbstractMap abstractMap2 = new AbstractMap(this._windowSize);
            abstractMap2.AddVisitable(450, 450, 2800, 130);
            abstractMap2.VuePosition = new Vector2(460f, 579f);
            abstractMap2.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, 1040, 320), windowSize, "map2/sky", 1, 1, 30, 1, -1, -1, false), 0.2f, 0.0f, true, false, false, true, false));
            abstractMap2.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 190, 960, 300), windowSize, "map2/mountain", 1, 1, 30, 1, -1, -1, false), 0.8f, 0.2f, true, false, false, true, false));
            abstractMap2.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 415, 1082, 193), windowSize, "map2/sand", 1, 1, 30, 1, -1, -1, false), 1f, 0.5f, true, false, false, true, false));
            abstractMap2.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 515, 1066, 92), windowSize, "map2/rock", 1, 1, 30, 1, -1, -1, false), 1f, 0.5f, true, true, false, true, false));
            abstractMap2.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(500, 450, 150, 150), this._windowSize, "game/heal_font_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, false, false, true));
            abstractMap2.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(250, 280, 320, 320), this._windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, false, false));
            abstractMap2.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(2550 + this._windowSize.Width / 2, 280, 320, 320), this._windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, true, false));

            AbstractMap abstractMap5 = new AbstractMap(this._windowSize);
            abstractMap5.AddVisitable(450, 450, 2800, 130);
            abstractMap5.VuePosition = new Vector2(460f, 579f);
            abstractMap5.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, 1040, 320), windowSize, "map2/sky", 1, 1, 30, 1, -1, -1, false), 0.2f, 0.0f, true, false, false, true, false));
            abstractMap5.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 190, 960, 300), windowSize, "map2/mountain", 1, 1, 30, 1, -1, -1, false), 0.8f, 0.2f, true, false, false, true, false));
            abstractMap5.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 415, 1082, 193), windowSize, "map2/sand", 1, 1, 30, 1, -1, -1, false), 1f, 0.5f, true, false, false, true, false));
            abstractMap5.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 515, 1066, 92), windowSize, "map2/rock", 1, 1, 30, 1, -1, -1, false), 1f, 0.5f, true, true, false, true, false));
            abstractMap5.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(250, 280, 320, 320), this._windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, false, false));
            abstractMap5.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(2800 + this._windowSize.Width / 2, 150, this._windowSize.Width / 2, this._windowSize.Height - 150), this._windowSize, "sprites/fireWall_11x6r23r44", 11, 6, 30, 23, 44, 1, true), 1f, 0.5f, false, false, false, true, false));
            abstractMap5.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(2800 + this._windowSize.Width / 2 -200, 300, 150,195), this._windowSize, "game/throne"), 1f, 0.5f, false, false, true, true, true));

            this._maps.Add(abstractMap1);
            this._maps.Add(abstractMap3);
            this._maps.Add(abstractMap4);
            this._maps.Add(abstractMap2);
            this._maps.Add(abstractMap5);
            this._currentMap = 0;
            this.personnage = new Personnage(this._windowSize, abstractMap2.VuePosition);
            this._players = new Personnage(this._windowSize, abstractMap2.VuePosition);
            this._mobsTextures = new List<Texture2D>();
            this._mobs = new List<List<Mob>>();

            this._hud = new HUD(this._windowSize);
            foreach (Sprite sprite in this.personnage.GetSkillsTips())
                this._hud.AddSprite(sprite);
            if (this.personnage.Weapons.Count <= 0)
                return;
            this._hud.AddWeapon(this.personnage.Weapons[0].Tip);

            if (!float.TryParse(EugLib.IO.FileStream.readFile("files/dash"), out DashSpeed))
            {
                DashSpeed = 4;
                EugLib.IO.FileStream.writeFile("files/dash", DashSpeed.ToString());
            }

            StopAllConnections();
        }
        public InGame(Rectangle windowSize, KeyboardState keyboardState, MouseState mouseState)
        {
            _windowSize = windowSize;
            _mouseState = mouseState;
            _keyboardState = keyboardState;
            _originalWindowSize = windowSize;

            _menu = new ContextMenu(_windowSize, new AnimatedSprite(new Rectangle(0, 30, 200, 50), _windowSize, "menu/ContextualMenuBlackFull"), "menu/contextMenuExit", 235);
            _menu.Title = new AnimatedSprite(new Rectangle(_menu.Position.Width / 2 - 75, 0, 150, 50), _windowSize, "menu/contextMenuText");
            _menu.Visible = false;
            _menu.Add(new AnimatedSprite(new Rectangle(_menu.Position.Width / 2 - 100, 65, 200, 22), _windowSize, "menu/contextMenuTextMainMenu"));
            _menu.CuadricPositionning(new Rectangle(0, 0, 150, 20), 65, 15, 10, 10, true);

            mouse = new Sprite(new Rectangle(-100, -100, 30, 50), _windowSize);

            _maps = new List<AbstractMap>();
            AbstractMap map;

            map = new AbstractMap(_windowSize);
            map.AddVisitable(450, 450, 2800, 130);
            map.VuePosition = new Vector2(460, 450 + 130 - 1);
            /*map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/sky1"), 0.2f, 0, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/back1r"), 0.8f, 0.2f, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, _windowSize.Height / 2, _windowSize.Width, _windowSize.Height / 2), _windowSize, "map1/fore1"), 1f, 0.5f, true));*/
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), windowSize, "map1/sky1"), 0.2f, 0, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 190, 960, 300), windowSize, "map1/back1r"), 0.8f, 0.2f, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 415, 1082, 193), windowSize, "map1/fore1"), 1f, 0.5f, true));
            //map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 515, 1066, 92), windowSize, "map1/fore1"), 1f, 0.5f, true, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(5, 150, _windowSize.Width / 2, _windowSize.Height - 150), _windowSize, "sprites/fireWall_11x6r23r44", 11, 6, 30, 23, 44, 1, true), 1f, 0.5f));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(2550 + _windowSize.Width / 2, 280, 320, 320), _windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, true));
            _maps.Add(map);

            map = new AbstractMap(_windowSize);
            map.AddVisitable(450, 450, 2800, 130);
            map.VuePosition = new Vector2(460, 450 + 130 - 1);
            /*map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/sky1"), 0.2f, 0, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/back1r"), 0.8f, 0.2f, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, _windowSize.Height / 2, _windowSize.Width, _windowSize.Height / 2), _windowSize, "map1/fore1"), 1f, 0.5f, true));*/
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, 1040, 320), windowSize, "map2/sky"), 0.2f, 0, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 190, 960, 300), windowSize, "map2/mountain"), 0.8f, 0.2f, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 415, 1082, 193), windowSize, "map2/sand"), 1f, 0.5f, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 515, 1066, 92), windowSize, "map2/rock"), 1f, 0.5f, true, true));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(250, 280, 320, 320), _windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, false));
            map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(2800 + _windowSize.Width / 2, 150, _windowSize.Width / 2, _windowSize.Height - 150), _windowSize, "sprites/fireWall_11x6r23r44", 11, 6, 30, 23, 44, 1, true), 1f, 0.5f));
            _maps.Add(map);
            _currentMap = 0;

            personnage = new Personnage(_windowSize, map.VuePosition);

            _mobsTextures = new List<Texture2D>();
            _mobs = new List<List<Mob>>();
            rand = new Random();
            _mobs.Add(new List<Mob>());
            _mobs.Add(new List<Mob>());
            for (int i = 0; i < 30; i++)
                _mobs[0].Add(new Mob(_windowSize, rand.Next(), new Vector2(1000, 580), 100, 200, "game/blitz", 5, 4, new Vector2(3f, 3f), new Vector2(1f, 0.5f), 300, 50, new Rectangle(900, 485, 2000, 100)));
            for (int i = 0; i < 50; i++)
                _mobs[1].Add(new Mob(_windowSize, rand.Next(), new Vector2(1000, 580), 100, 200, "game/blitz", 5, 4, new Vector2(3f, 3f), new Vector2(1f, 0.5f), 300, 50, new Rectangle(900, 485, 2000, 100)));
            foreach (List<Mob> l in _mobs)
                foreach (Mob m in l)
                {
                    m.AddGraphicalBounds(CharacterActions.WalkRight, new Rectangle(6, 6, 10, 30));
                    m.AddGraphicalBounds(CharacterActions.WalkLeft, new Rectangle(1, 1, 5, 30));
                    m.AddGraphicalBounds(CharacterActions.StandLeft, new Rectangle(3, 3, 3, 30));
                    m.AddGraphicalBounds(CharacterActions.StandRight, new Rectangle(8, 8, 8, 30));
                    m.AddGraphicalBounds(CharacterActions.Attack1Left, new Rectangle(11, 11, 12, 4));
                    m.AddGraphicalBounds(CharacterActions.Attack1Right, new Rectangle(16, 16, 17, 4));
                    m.AddGraphicalBounds(CharacterActions.ReceiveAttackLeft, new Rectangle(13, 13, 13, 4));
                    m.AddGraphicalBounds(CharacterActions.ReceiveAttackRight, new Rectangle(18, 18, 18, 4));
                }

            _hud = new HUD(_windowSize);
        }