Ejemplo n.º 1
0
        public Car()
        {
            EmptyTank     = new EmptyTankState(this);
            FullTank      = new FullTankState(this);
            EngineStarted = new EngineStartedState(this);
            DrivingState  = new DrivingState(this);

            _currentState = EmptyTank;
            Gasoline      = 0;
        }
Ejemplo n.º 2
0
        public Car()
        {
            Fuel = 0;

            EmptyTank     = new EmptyTankState(this);
            TankWithFuel  = new TankWithFuelState(this);
            EngineStarted = new EngineStartedState(this);
            Driving       = new DrivingState(this);

            _currentState = EmptyTank;
        }