Пример #1
0
        private void LoadTournaments()
        {
            TriadTournamentDB tournamentDB = TriadTournamentDB.Get();

            tournaments.Clear();

            for (int idx = 0; idx < tournamentDB.tournaments.Count; idx++)
            {
                var tourEntry = tournamentDB.tournaments[idx];
                if (tourEntry != null)
                {
                    tournaments.Add(new TournamentModelProxy(tourEntry));
                }
            }

            var view = CollectionViewSource.GetDefaultView(tournaments);

            if (view.SortDescriptions.Count == 0)
            {
                view.SortDescriptions.Add(new SortDescription());
            }
        }
Пример #2
0
        private bool LoadAssets()
        {
            bool bResult = false;

            try
            {
                var resManager = new ResourceManager("FFTriadBuddy.Properties.Resources", Assembly.GetExecutingAssembly());
                var assets     = (byte[])resManager.GetObject("assets");

                if (AssetManager.Get().Init(assets))
                {
                    LocalizationDB.SetCurrentUserLanguage(CultureInfo.CurrentCulture.Name);

                    bResult = TriadCardDB.Get().Load();
                    bResult = bResult && TriadNpcDB.Get().Load();
                    bResult = bResult && ImageHashDB.Get().Load();
                    bResult = bResult && TriadTournamentDB.Get().Load();
                    bResult = bResult && LocalizationDB.Get().Load();

                    if (bResult)
                    {
                        SettingsModel.Initialize();
                        IconDB.Get().Load();
                        ModelProxyDB.Get().Load();

                        TriadGameSession.StaticInitialize();
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLine("Init failed: " + ex);
                bResult = false;
            }

            return(bResult);
        }