Example #1
0
        private void GoNewState()
        {
            PrepareGameState = PrepareGameStates.NewGame;

            objGetData = new GetData();

            GoCreateCharState();

            GoPlayGameState();
        }
Example #2
0
        private void GoLoadState()
        {
            PrepareGameState = PrepareGameStates.LoadGame;

            bool blnSuccess = true;
            try
            {
                using (Stream objFileStream = File.OpenRead(strSaveFile))
                {
                    objGetData = (GetData)(objSerializer.Deserialize(objFileStream));
                }
            }
            catch (Exception e)
            {
                blnSuccess = false;
                lblOutput.Text = string.Format("Failed loading file {0}", strSaveFile);
            }

            if (blnSuccess)
            {
                lblOutput.Text = lblOutput.Text + "Game loaded.";
                GoPlayGameState();
            }
            else
            {
                GoInitialState();
            }
        }