Beyond_Beyaan.GameMain.LoadGame C# (CSharp) Метод

LoadGame() публичный Метод

public LoadGame ( string filename ) : bool
filename string
Результат bool
        public bool LoadGame(string filename)
        {
            string path = Path.Combine(GameDataSet.FullName, "Saves");
            if (!Directory.Exists(path))
            {
                //No folder exists, impossible to load anything
                return false;
            }
            try
            {
                XDocument doc = XDocument.Load(Path.Combine(path, filename));
                XElement root = doc.Root;
                if (!Galaxy.Load(root, this))
                {
                    return false;
                }
                if (!EmpireManager.Load(root))
                {
                    return false;
                }
                Galaxy.Reconcilate(EmpireManager);
                if (_galaxyScreen != null)
                {
                    _galaxyScreen.ResetCamera();
                }
                if (_processingTurnScreen != null)
                {
                    _processingTurnScreen.ResetCamera();
                }
                ChangeToScreen(Screen.Galaxy);
                return true;
            }
            catch
            {
                return false;
            }
        }