コード例 #1
0
        // timer that waits for pages to load their data (usually to recieve it from the server) before displaying the page

        private void LoadPage_Tick(object sender, EventArgs e)
        {
            switch (currentPageID)
            {
            case 1:
                if (GUIlobbyRoom.DoneLoadingData())         // this is initially false and is being checked every second; When page data has been loaded this becomes true
                {
                    loadPage.Stop();                        // stop the check that occures every second once the data was loaded
                    MainFrame.Content = GUIlobbyRoom;       // display the page
                    GUIloading        = null;               // you no longer need the loading GUI page
                }
                else
                {
                    GUIloading.updateMessages(GUIlobbyRoom.getLoadedDataChecklist());     // update the checklist for loaded data
                }
                break;

            case 2:
                if (GUIcollection.DoneLoading())
                {
                    loadPage.Stop();
                    MainFrame.Content = GUIcollection;
                    GUIloading        = null;
                }
                else
                {
                    GUIloading.updateMessages(GUIcollection.getLoadedDataChecklist());
                }
                break;

            case 3:
                if (GUIpreGameRoom.DoneLoading())
                {
                    loadPage.Stop();
                    MainFrame.Content = GUIpreGameRoom;
                    GUIloading        = null;
                }
                else
                {
                    GUIloading.updateMessages(GUIpreGameRoom.getLoadedDataChecklist());
                }
                break;

            case 4:
                if (GUIgameRoom.DoneLoading())
                {
                    loadPage.Stop();
                    MainFrame.Content = GUIgameRoom;
                    GUIloading        = null;
                    GUIgameRoom.startRolling();
                }
                else
                {
                    GUIloading.updateMessages(GUIgameRoom.getLoadedDataChecklist());
                }
                break;

            default: break;
            }
        }
コード例 #2
0
        // PRE GAME ROOM

        internal void loadPreGameRoom(int GameRoomID, string OwnNickName, string OppNickName)
        {
            GUIpreGameRoom = new GUIPages.GUIPreGameRoom(this, com, GameRoomID, OwnNickName, OppNickName);
            List <string> loadedDataChecklistTitles = new List <string>()
            {
                "Fetching Decks"
            };

            GUIloading        = new GUIPages.GUILoading(GUIpreGameRoom.BackgroundImageSource, loadedDataChecklistTitles, GUIpreGameRoom.getLoadedDataChecklist());
            MainFrame.Content = GUIloading;
            currentPageID     = 3;
            loadPage.Start();
        }
コード例 #3
0
        // COLLECTION

        public void loadCollection()
        {
            GUIcollection = new GUIPages.GUICollection(this, com, CardCollection);
            List <string> loadedDataChecklistTitles = new List <string>()
            {
                "Fetching Decks",
            };

            GUIloading        = new GUIPages.GUILoading(GUIcollection.BackgroundImageSource, loadedDataChecklistTitles, GUIcollection.getLoadedDataChecklist());
            MainFrame.Content = GUIloading;
            currentPageID     = 2;
            loadPage.Start();
        }
コード例 #4
0
        // GAME ROOM

        public void loadGameRoom(int GameRoomID, int DeckID, string OwnNickName, string OppNickName)
        {
            GUIgameRoom = new GUIPages.GUIGameRoom(this, com, GameRoomID, DeckID, OwnNickName, OppNickName, CardCollection);
            List <string> loadedDataChecklistTitles = new List <string>()
            {
                "Setting up initial conditions",
                "Fetching hand",
                "Waiting for opponent"
            };

            GUIloading        = new GUIPages.GUILoading(GUIgameRoom.BackgroundImageSource, loadedDataChecklistTitles, GUIgameRoom.getLoadedDataChecklist());
            MainFrame.Content = GUIloading;
            currentPageID     = 4;
            loadPage.Start();
        }
コード例 #5
0
        // GAME LOBBY

        public void loadGameLobby()
        {
            GUIlobbyRoom = new GUIPages.GUILobbyRoom(this, com);
            List <string> loadedDataChecklistTitles = new List <string>()
            {
                "Populating User List",
                "Fetching User Data",
                "Fetching Game Rooms",
                "Fetching Card Database"
            };

            GUIloading        = new GUIPages.GUILoading(GUIlobbyRoom.BackgroundImageSource, loadedDataChecklistTitles, GUIlobbyRoom.getLoadedDataChecklist());
            MainFrame.Content = GUIloading;
            currentPageID     = 1;
            loadPage.Start();
        }