Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (this.Session["savedGame"] != null)
         {
             _savedGame = (SavedGame)this.Session["savedGame"];
             loadGameFromSave(_savedGame);
         }
         else
         {
             _levelObject.IntializeGame();
             _userName  = (String)this.Session["userName"];
             _savedGame = new SavedGame(_levelObject, _buttonIdsToUnflip, _permanentlyFlipped, _gameLevel + "", lbltimer.Text, _noOfClicks + "", _noOfPictureSets + "", _score + "", _userName, HttpContext.Current.Request.RawUrl);
             this.Session["savedGame"] = _savedGame;
         }
     }
     else
     {
         if (this.Session["savedGame"] != null)
         {
             _savedGame = (SavedGame)this.Session["savedGame"];
             loadGameFromSave(_savedGame);
         }
     }
 }