Esempio n. 1
0
        static void Main(string[] args)
        {
            //Car car = new Car();
            //car.AddFule(50);
            //Console.WriteLine(car.GetCarState());
            //car.IncreaseSpeed();
            //car.IncreaseSpeed();
            //Console.WriteLine(car.GetCarState());
            //car.IncreaseSpeed();

            CarState carState = new CarState()
            {
                Speed = 100,
                Fule  = 60
            };

            var result = carState.ToString();

            Console.WriteLine(result);
        }
        static void Main(string[] args)
        {
            Car car = new Car();

            car.AddFule(2000);
            car.IncreaseSpeed();
            car.Killometer();
            car.IncreaseSpeed();
            car.Killometer();
            car.IncreaseSpeed();
            car.Killometer();
            car.IncreaseSpeed();
            car.Killometer();
            car.DecreaseSpeed();
            car.Killometer();

            CarState carState = car.GetState();


            Car c1 = new Car(carState);

            Console.WriteLine($"{c1.GetState().Fule} {c1.GetState().Speed}");
        }