Example #1
0
 public Automat(int numberOfApartments)
 {
     NumberOfApartments   = numberOfApartments;
     WaitingState         = new WaitingState(this);
     GotApplicationState  = new GotApplicationState(this);
     ApartmentRentedState = new ApartmentRentedState(this);
     FullyRentedState     = new FullyRentedState(this);
     state = WaitingState;
 }
Example #2
0
        public AutomatServer()
        {
            NumberOfApartments   = 9;
            WaitingState         = new WaitingState(this);
            GotApplicationState  = new GotApplicationState(this);
            ApartmentRentedState = new ApartmentRentedState(this);
            FullyRentedState     = new FullyRentedState(this);
            state = WaitingState;

            thread = new Thread(Run);
            thread.Start();
        }