public String DispenseKeys() { if (_automat.Count <= 0) { _automat.SetState(_automat.GetFullyRentedState()); } else { _automat.SetState(_automat.GetWaitingState()); } return("Here are your keys!"); }
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 GotApplication() { _automat.SetState(_automat.GetGotApplicationState()); return("Thanks for the application."); }