Esempio n. 1
0
        public TriadGameModel()
        {
            TriadNpc npcOb = TriadNpcDB.Get().npcs.Find(x => x?.Id == PlayerSettingsDB.Get().lastNpcId);

            if (npcOb == null)
            {
                npcOb = TriadNpcDB.Get().Find("Triple Triad master");
            }

            SetNpc(npcOb);
        }
Esempio n. 2
0
        private void LoadNpc()
        {
            TriadNpcDB npcDB = TriadNpcDB.Get();

            npcs.Clear();

            for (int idx = 0; idx < npcDB.npcs.Count; idx++)
            {
                var npcEntry = npcDB.npcs[idx];
                if (npcEntry != null)
                {
                    npcs.Add(new NpcModelProxy(npcEntry));
                }
            }
        }
Esempio n. 3
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);
        }