//Lấy vào chuỗi xml định nghĩa một số thông tin riêng của Loading state (hình
        //ảnh backGround, hình ảnh processBar) mảng các objectManager cần load và kiểu
        //của Game state kế tiếp.
        public void GetDataLoading(ContentManager content, string xmlInfo, GameObjectManager[] objectManagerArray, Type type)
        {
            _nObjectManager     = objectManagerArray.Length;
            _objectManagerArray = new GameObjectManager[_nObjectManager];

            for (int i = 0; i < _nObjectManager; i++)
            {
                _objectManagerArray[i] = objectManagerArray[i];
                //1 step là 1 doi tuong prototype cần load.
                _stepLengh += _objectManagerArray[i]._nprototype;
            }
            _stepLengh++;       // them cai innit cho gamestate tip theo.
            _type    = type;    //Lưu lại type của state tip theo
            _xmlInfo = xmlInfo; //Lưu lại chuoi XML luu thong tin rieng cua loadind state

            XmlDocument _doc = new XmlDocument();

            _doc.Load(_xmlInfo);

            XmlNode     _backGroundNote = _doc.DocumentElement.SelectSingleNode("BackGround");
            XmlNodeList _imageNoteList  = _backGroundNote.SelectNodes("//Image");

            _nBackGroundImage = _imageNoteList.Count;
            _backGroundImage  = new GameSprite[_nBackGroundImage];
            for (int i = 0; i < _nBackGroundImage; i++)
            {
                Texture2D _temp  = content.Load <Texture2D>(_imageNoteList[i].SelectSingleNode("Path").InnerText);
                int       _xTemp = int.Parse(_imageNoteList[i].SelectSingleNode("X").InnerText) - (int)GlobalVariables.dX;
                int       _yTemp = int.Parse(_imageNoteList[i].SelectSingleNode("Y").InnerText) - (int)GlobalVariables.dY;
                _backGroundImage[i]         = new GameSprite(_temp, _xTemp, _yTemp);
                _backGroundImage[i].Xoffset = 0;
                _backGroundImage[i].Yoffset = 0;
            }

            _delayTime = int.Parse(_doc.DocumentElement.SelectSingleNode("DelayTime").InnerText);
            string _processXMLInfo = _doc.DocumentElement.SelectSingleNode("ProcessBar").SelectSingleNode("ContentName").InnerText;

            //Truyền va init tại chỗ vì cái ProcessBarManager chỉ xài cho loading state
            ProcessBarManager pbm = new ProcessBarManager(_processXMLInfo);

            for (int i = 0; i < pbm._nprototype; i++)
            {
                pbm.InitOne(content, i);
            }
            _processBar = (ProcessBar)pbm.CreateObject(0);
        }
        //Lấy vào chuỗi xml định nghĩa một số thông tin riêng của Loading state (hình
        //ảnh backGround, hình ảnh processBar) mảng các objectManager cần load và kiểu
        //của Game state kế tiếp.
        public void GetDataLoading(ContentManager content, string xmlInfo, GameObjectManager[] objectManagerArray, Type type)
        {
            _nObjectManager = objectManagerArray.Length;
            _objectManagerArray = new GameObjectManager[_nObjectManager];

            for (int i = 0; i < _nObjectManager; i++)
            {
                _objectManagerArray[i] = objectManagerArray[i];
                //1 step là 1 doi tuong prototype cần load.
                _stepLengh += _objectManagerArray[i]._nprototype;
            }
            _stepLengh++; // them cai innit cho gamestate tip theo.
            _type = type; //Lưu lại type của state tip theo
            _xmlInfo = xmlInfo; //Lưu lại chuoi XML luu thong tin rieng cua loadind state

            XmlDocument _doc = new XmlDocument();
            _doc.Load(_xmlInfo);

            XmlNode _backGroundNote = _doc.DocumentElement.SelectSingleNode("BackGround");
            XmlNodeList _imageNoteList = _backGroundNote.SelectNodes("//Image");

            _nBackGroundImage = _imageNoteList.Count;
            _backGroundImage = new GameSprite[_nBackGroundImage];
            for (int i = 0; i < _nBackGroundImage; i++)
            {
                Texture2D _temp = content.Load<Texture2D>(_imageNoteList[i].SelectSingleNode("Path").InnerText);
                int _xTemp = int.Parse(_imageNoteList[i].SelectSingleNode("X").InnerText) - (int)GlobalVariables.dX;
                int _yTemp = int.Parse(_imageNoteList[i].SelectSingleNode("Y").InnerText) - (int)GlobalVariables.dY;
                _backGroundImage[i] = new GameSprite(_temp, _xTemp, _yTemp);
                _backGroundImage[i].Xoffset = 0;
                _backGroundImage[i].Yoffset = 0;
            }

            _delayTime = int.Parse(_doc.DocumentElement.SelectSingleNode("DelayTime").InnerText);
            string _processXMLInfo = _doc.DocumentElement.SelectSingleNode("ProcessBar").SelectSingleNode("ContentName").InnerText;

            //Truyền va init tại chỗ vì cái ProcessBarManager chỉ xài cho loading state
            ProcessBarManager pbm = new ProcessBarManager(_processXMLInfo);
            for (int i = 0; i < pbm._nprototype; i++)
            {
                pbm.InitOne(content, i);
            }
            _processBar = (ProcessBar)pbm.CreateObject(0);
        }