Esempio n. 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;
 }
        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();
        }
Esempio n. 3
0
 public void SetState( BaseState state )
 {
     this.state = state;
 }