Пример #1
0
 /*
  * this method changes the state of the current member to the previous state
  * */
 public void prevState()
 {
     if (currentState.getType().CompareTo("Gold") == 0)
     {
         currentState = new stateSilver();
     }
     else if (currentState.getType().CompareTo("Silver") == 0)
     {
         currentState = new stateNormal();
     }
     else if (currentState.getType().CompareTo("Normal") == 0)
     {
         return;
     }
 }
Пример #2
0
 public Member(int memberID, String memberUsername, String memberPassword, String memberEmail)
 {
     this.memberID       = memberID;
     this.memberUsername = memberUsername;
     this.memberPassword = "******";
     passwordLastChanged = DateTime.Now;
     this.memberEmail    = memberEmail;
     this.loginStatus    = false;
     this.accountStatus  = true;        //user that not yet confirmed his email should be false - TODO when sending to mail is done
     //this.FriendsList = new List<Friendship>();
     currentState  = new stateNormal(); // new user begins as a Normal user
     pastPasswords = new List <Password>();
     setPassword("firstPass", memberPassword);
     FriendsList = new List <Member>();
     //creating confirmation code and sending it to user email
     this.confirmationCode = creatingConfirmationCodeAndSending(memberUsername, memberEmail);
 }