예제 #1
0
 public string DispenseKeys()
 {
     if (automat.Count <= 0)
     {
         automat.SetState(automat.GetFullyRentedState());
     }
     else
     {
         automat.SetState(automat.GetWaitingState());
     }
     return("your keys");
 }
예제 #2
0
파일: main.cs 프로젝트: staherianYMCA/test
 public string DispenseKeys()
 {
     if (_automat.Count <= 0)
     {
         _automat.SetState(_automat.GetFullyRentedState());
     }
     else
     {
         _automat.SetState(_automat.GetWaitingState());
     }
     return("Here are your keys!");
 }
예제 #3
0
파일: main.cs 프로젝트: staherianYMCA/test
        public string CheckApplication()
        {
            var yesNo = _random.Next() % 10;

            if (yesNo > 4 && _automat.Count > 0)
            {
                _automat.SetState(_automat.GetApartmentRentedState());
                return("Congratulations, you were approved.");
            }
            else
            {
                _automat.SetState(_automat.GetWaitingState());
                return("Sorry, you were not approved.");
            }
        }
        public string CheckApplication()
        {
            var yesno = random.Next() % 10;

            if (yesno > 4 && automat.Count > 0)
            {
                automat.SetState(automat.GetApartmentRentState());
                return("You were approved");
            }
            else
            {
                automat.SetState(automat.GetWaitingState());
                return("you not approved");
            }
        }