コード例 #1
0
ファイル: MeActivity.cs プロジェクト: wr0om/Cicada
 /// <summary>
 /// Initializes objects for this activity
 /// </summary>
 private void InitObjects()
 {
     fd   = new FirebaseData();
     sp   = new SPData(this);
     user = new User
     {
         Email    = sp.GetStringData(Constants.EMAIL),
         UserName = sp.GetStringData(Constants.USERNAME),
         Password = sp.GetStringData(Constants.PASSWORD)
     };
 }
コード例 #2
0
 /// <summary>
 /// Initialize objects
 /// </summary>
 private void InitObjects()
 {
     isInGame = false;
     db       = new SqlDb();
     fd       = new FirebaseData();
     sp       = new SPData(this);
     user     = new User();
     game     = new Game();
     if (sp.GetStringData(Constants.EMAIL) != null)
     {
         user.Email = sp.GetStringData(Constants.EMAIL);
     }
     if (sp.GetStringData(Constants.USERNAME) != null)
     {
         user.UserName = sp.GetStringData(Constants.USERNAME);
     }
     if (sp.GetStringData(Constants.PASSWORD) != null)
     {
         user.Password = sp.GetStringData(Constants.PASSWORD);
     }
     if (sp.GetStringData(Constants.PROFILE_PIC_URL) != null)
     {
         user.ProfilePicture_url = sp.GetStringData(Constants.PROFILE_PIC_URL);
     }
 }
コード例 #3
0
ファイル: GameActivity.cs プロジェクト: wr0om/Cicada
 /// <summary>
 /// Initializes all objects needed for GameActivity
 /// </summary>
 private void InitObjects()
 {
     fd                      = new FirebaseData();
     game                    = new Game();
     sp                      = new SPData(this);
     user                    = new User();
     opponent                = new User();
     sqlDb                   = new SqlDb();
     isNewQuestion           = true;
     isGameOver              = false;
     isInRest                = true;
     user.UserName           = sp.GetStringData(Constants.USERNAME);
     user.Email              = sp.GetStringData(Constants.EMAIL);
     user.Password           = sp.GetStringData(Constants.PASSWORD);
     user.ProfilePicture_url = sp.GetStringData(Constants.PROFILE_PIC_URL);
     gameNum                 = Intent.GetStringExtra(Constants.GAMENUM);
     game.GameNum            = gameNum;
     game.Subject            = Intent.GetStringExtra(Constants.SUBJECT);
     opponent.UserName       = Intent.GetStringExtra(Constants.OPPONENT_NAME); //we get the opponent's name from HomeActivity's intent call
     isHost                  = Intent.GetBooleanExtra(Constants.ISHOST_GAME, false);
     lastIndex               = -1;                                             //so we don't mistakenly check and think this was an index
 }