예제 #1
0
    static void Main(string[] args)
    {
        Car1 myCar = new Car1("Auto", "Blue", "high", 2019, 4, 80, Car1.Model.M3, Car.CarType.Sedan);

        myCar.Calculate();

        WriteLine("The info about the vehicle:");
        WriteLine($"1. Type: {myCar.Name}.\n2. Color: {myCar.Color}\n3. Year of production: {myCar.YearMade}");
        WriteLine($"4. Model: {myCar.CurrentModel}\n5. Car Type: {myCar.CurrentType}\n6. Comfort level: {myCar.ComfortLevel}]n\n");
        WriteLine($"The price is {myCar.Price}\n\n");

        Car2 friendsCar = new Car2("Auto", "Silver", "medium", 2012, 4, 400, Car2.Model.W140, Car.CarType.Sedan);

        friendsCar.Calculate();

        WriteLine("The info about your friend's vehicle:");
        WriteLine($"1. Type: {friendsCar.Name}.\n2. Color: {friendsCar.Color}\n3. Year of production: {friendsCar.YearMade}");
        WriteLine($"4. Model: {friendsCar.CurrentModel}\n5. Car Type: {friendsCar.CurrentType}\n6. Comfort level: {friendsCar.ComfortLevel}\n\n");
        WriteLine("Additional functions\n\n");
        WriteLine("The program will show all models available:");
        myCar.ShowModels();
        friendsCar.ShowModels();

        IModels testCar = new Car1("Auto", "Green", "low", 2010, 4, 65, Car1.Model.X5, Car.CarType.SUV);

        testCar.Restore(testCar.Available);
        testCar.Buy(testCar.Available);
        WriteLine(testCar.Available);

        IMovable anotherCar = new Car2("Auto", "Silver", "medium", 2012, 4, 400, Car2.Model.W140, Car.CarType.Sedan);

        anotherCar.MaxSpeed = int.Parse(ReadLine());
        WriteLine("The time it takes the vehicle to get to destination point is: {0}", anotherCar.GetTime(250, anotherCar.MaxSpeed));
    }
예제 #2
0
    static void Main(string[] args)
    {
        Car1 myCar = new Car1("Auto", "Black", "high", 2019, 4, 80, Car1.Model.M3, Car.CarType.Sedan);

        myCar.Calculate();

        WriteLine("The info about the vehicle:");
        WriteLine($"1. Type: {myCar.Name}.\n2. Color: {myCar.Color}\n3. Year of production: {myCar.YearMade}");
        WriteLine($"4. Model: {myCar.CurrentModel}\n5. Car Type: {myCar.CurrentType}\n6. Comfort level: {myCar.ComfortLevel}]n\n");
        WriteLine($"The price is {myCar.Price}\n\n");

        Car2 friendsCar = new Car2("Auto", "Silver", "medium", 2012, 4, 400, Car2.Model.W140, Car.CarType.Sedan);

        friendsCar.Calculate();

        WriteLine("The info about your friend's vehicle:");
        WriteLine($"1. Type: {friendsCar.Name}.\n2. Color: {friendsCar.Color}\n3. Year of production: {friendsCar.YearMade}");
        WriteLine($"4. Model: {friendsCar.CurrentModel}\n5. Car Type: {friendsCar.CurrentType}\n6. Comfort level: {friendsCar.ComfortLevel}\n\n");
        WriteLine($"The price is {friendsCar.Price}\n\n");

        Car yourCar1 = new Car1("Auto", "Black", "high", 2019, 4, 80, Car1.Model.M3, Car.CarType.Sedan);

        yourCar1.TestDrive();
        Car yourCar2 = new Car2("Auto", "Black", "high", 2019, 4, 80, Car1.Model.M3, Car.CarType.Sedan);

        yourCar2.TestDrive();
    }
예제 #3
0
 // Start is called before the first frame update
 void Start()
 {
     _uiManager   = GameObject.Find("Canvas").GetComponent <UIManager>();
     _gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
     c1           = GameObject.Find("Car1").GetComponent <Car1>();
     c2           = GameObject.Find("Car2").GetComponent <Car2>();
 }
예제 #4
0
        public BuildingScene(Demo demo, string name, int instanceIndex, string info)
        {
            this.demo = demo;
            this.name = name;
            this.instanceIndexName = " " + instanceIndex.ToString();
            this.info = info;

            // Create a new objects in the scene
            skyInstance1       = new Sky(demo, 1);
            quadInstance1      = new Quad(demo, 1);
            cursorInstance     = new Cursor(demo);
            shotInstance       = new Shot(demo);
            plant2Instance1    = new Plant2(demo, 1);
            building1Instance1 = new Building1(demo, 1);
            car1Instance1      = new Car1(demo, 1);
            ragdoll3Instance1  = new Ragdoll3(demo, 1);
            box1Instance1      = new Box1(demo, 1);
            lamp1Instance1     = new Lamp1(demo, 1);
            lamp1Instance2     = new Lamp1(demo, 2);
            camera2Instance1   = new Camera2(demo, 1);
            lightInstance      = new Lights(demo);

            // Create a new controllers in the scene
            skyDraw1Instance1          = new SkyDraw1(demo, 1);
            cursorDraw1Instance        = new CursorDraw1(demo);
            car1Animation1Instance1    = new Car1Animation1(demo, 1);
            lamp1Animation1Instance1   = new Lamp1Animation1(demo, 1);
            lamp1Animation1Instance2   = new Lamp1Animation1(demo, 2);
            camera2Animation1Instance1 = new Camera2Animation1(demo, 1);
            camera2Draw1Instance1      = new Camera2Draw1(demo, 1);
        }
예제 #5
0
        public BridgesScene(Demo demo, string name, int instanceIndex, string info)
        {
            this.demo = demo;
            this.name = name;
            this.instanceIndexName = " " + instanceIndex.ToString();
            this.info = info;

            // Create a new objects in the scene
            skyInstance1      = new Sky(demo, 1);
            quadInstance1     = new Quad(demo, 1);
            cursorInstance    = new Cursor(demo);
            shotInstance      = new Shot(demo);
            car1Instance1     = new Car1(demo, 1);
            bridge1Instance1  = new Bridge1(demo, 1);
            bridge1Instance2  = new Bridge1(demo, 2);
            ragdoll1Instance1 = new Ragdoll1(demo, 1);
            camera1Instance1  = new Camera1(demo, 1);
            lightInstance     = new Lights(demo);

            // Create a new controllers in the scene
            skyDraw1Instance1          = new SkyDraw1(demo, 1);
            cursorDraw1Instance        = new CursorDraw1(demo);
            car1Animation1Instance1    = new Car1Animation1(demo, 1);
            camera1Animation1Instance1 = new Camera1Animation1(demo, 1);
            camera1Draw1Instance1      = new Camera1Draw1(demo, 1);
        }
예제 #6
0
파일: Form1.cs 프로젝트: cookiehhh/Cshape
        private void button1_Click(object sender, EventArgs e)
        {
            Car1 car = new Car1();

            car.Name = "咪咪";
            car.Age  = 9;
            car.shurt();
        }
예제 #7
0
        //建造者模式的调用
        public static void GetBuilder()
        {
            Director director        = new Director();
            Builder  buickCarBuilder = new BuickBuilder();
            Builder  aoDiCarBuilder  = new AoDiBuilder();

            director.Construct(buickCarBuilder);
            //组装完成了,我来驾驶别克了
            Car1 buickCar = buickCarBuilder.GetCar();

            buickCar.Show();

            director.Construct(aoDiCarBuilder);
            Car1 aoDiCar = aoDiCarBuilder.GetCar();

            aoDiCar.Show();
        }
예제 #8
0
    public void SerializationTest()
    {
        var ms   = new MemoryStream();
        var car1 = new Car1 {
            Id = 10, Name = "Car1"
        };
        var xs = new XmlSerializer(typeof(Car1));
        var tw = new StreamWriter(ms);

        xs.Serialize(tw, car1);

        ms.Seek(0, SeekOrigin.Begin);
        xs = new XmlSerializer(typeof(Car2));
        var tr   = new StreamReader(ms);
        var car2 = (Car2)xs.Deserialize(tr);

        Assert.AreEqual(car1.Id, car2.CarId);
        Assert.AreEqual(car1.Name, car2.CarName);
    }
예제 #9
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     Debug.Log("Collided with : " + other.name);
     if (other.tag == "Car1")
     {
         Car1 c1 = other.GetComponent <Car1>();
         if (c1 != null)
         {
             if (c1.scoreBoostActive == true)
             {
                 c1.collectedAfterBoost1 += 2;
                 _uiManager.updateScore();
                 AudioSource.PlayClipAtPoint(_clip, Camera.main.transform.position, 1f);
             }
             else
             {
                 c1.collectedCoins1++;
                 AudioSource.PlayClipAtPoint(_clip, Camera.main.transform.position, 1f);
             }
         }
     }
     if (other.tag == "Car2")
     {
         Car2 c2 = other.GetComponent <Car2>();
         if (c2 != null)
         {
             if (c2.scoreBoostActive == true)
             {
                 c2.collectedAfterBoost2 += 2;
                 _uiManager.updateScore();
                 AudioSource.PlayClipAtPoint(_clip, Camera.main.transform.position, 1f);
             }
             else
             {
                 c2.collectedCoins2++;
                 AudioSource.PlayClipAtPoint(_clip, Camera.main.transform.position, 1f);
             }
         }
     }
     _uiManager.updateScore();
     Destroy(this.gameObject);
 }
예제 #10
0
    static void Main(string[] args)
    {
        Car1 myCar = new Car1("Auto", "Black", "high", 2019, 4, 80, Car1.Model.M3, Car.CarType.Sedan);

        myCar.Calculate();

        Car2 friendsCar = new Car2("Auto", "Silver", "medium", 2012, 4, 400, Car2.Model.W140, Car.CarType.Sedan);

        friendsCar.Calculate();

        Choose         choice  = WhoIsBetter;
        MessageHandler handler = delegate(string message) { Console.WriteLine("{0}", message); };

        handler("Enter the sum you would like to add:");
        int money;

        try
        {
            Int32.TryParse(Console.ReadLine(), out money);
            if (money <= 0)
            {
                throw new Exception("You've entered invalid data!");
            }
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
            throw;
        }

        myCar.Purchase(money);
        friendsCar.Purchase(money);

        var result = choice(myCar, friendsCar);

        handler("Nice choice!");
    }
예제 #11
0
        public TerrainWithWaterScene(Demo demo, string name, int instanceIndex, string info)
        {
            this.demo = demo;
            this.name = name;
            this.instanceIndexName = " " + instanceIndex.ToString();
            this.info = info;

            // Create a new objects in the scene
            skyInstance1          = new Sky(demo, 1);
            cursorInstance        = new Cursor(demo);
            shotInstance          = new Shot(demo);
            terrainInstance1      = new Terrain(demo, 1);
            lakeInstance1         = new Lake(demo, 1, 8, 8);
            defaultShapesInstance = new DefaultShapes(demo);
            columnInstance1       = new Column(demo, 1);
            columnInstance2       = new Column(demo, 2);
            pierInstance1         = new Pier(demo, 1);
            ragdoll2Instance1     = new Ragdoll2(demo, 1);
            boat1Instance1        = new Boat1(demo, 1);
            car1Instance1         = new Car1(demo, 1);
            box2Instance1         = new Box2(demo, 1);
            crab1Instance1        = new Crab1(demo, 1);
            torusMesh             = new TorusMesh(demo, 1);
            camera2Instance1      = new Camera2(demo, 1);
            lightInstance         = new Lights(demo);

            // Create a new controllers in the scene
            skyDraw1Instance1          = new SkyDraw1(demo, 1);
            cursorDraw1Instance        = new CursorDraw1(demo);
            boat1Animation1Instance1   = new Boat1Animation1(demo, 1);
            car1Animation1Instance1    = new Car1Animation1(demo, 1);
            terrainDraw1Instance1      = new TerrainDraw1(demo, 1);
            lakeDraw1Instance1         = new LakeDraw1(demo, 1, 8, 8);
            camera2Animation1Instance1 = new Camera2Animation1(demo, 1);
            camera2Draw1Instance1      = new Camera2Draw1(demo, 1);
        }
예제 #12
0
        public void Create()
        {
            string sceneInstanceIndexName = name + instanceIndexName;

            if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null)
            {
                return;
            }

            scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName);

            // Initialize maximum number of solver iterations for the scene
            scene.MaxIterationCount = 10;

            // Initialize time of simulation for the scene
            scene.TimeOfSimulation = 1.0f / 15.0f;

            Initialize();

            // Initialize objects in the scene
            skyInstance1.Initialize(scene);
            quadInstance1.Initialize(scene);
            cursorInstance.Initialize(scene);
            shotInstance.Initialize(scene);
            car1Instance1.Initialize(scene);
            bridge1Instance1.Initialize(scene);
            bridge1Instance2.Initialize(scene);
            ragdoll1Instance1.Initialize(scene);
            camera1Instance1.Initialize(scene);
            lightInstance.Initialize(scene);

            // Initialize controllers in the scene
            skyDraw1Instance1.Initialize(scene);
            cursorDraw1Instance.Initialize(scene);
            car1Animation1Instance1.Initialize(scene);
            camera1Animation1Instance1.Initialize(scene);
            camera1Draw1Instance1.Initialize(scene);

            // Create shapes shared for all physics objects in the scene
            // These shapes are used by all objects in the scene
            Demo.CreateSharedShapes(demo, scene);

            // Create shapes for objects in the scene
            Sky.CreateShapes(demo, scene);
            Quad.CreateShapes(demo, scene);
            Cursor.CreateShapes(demo, scene);
            Shot.CreateShapes(demo, scene);
            Car1.CreateShapes(demo, scene);
            Bridge1.CreateShapes(demo, scene);
            Ragdoll1.CreateShapes(demo, scene);
            Camera1.CreateShapes(demo, scene);
            Lights.CreateShapes(demo, scene);

            // Create physics objects for objects in the scene
            skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f));
            quadInstance1.Create(new Vector3(0.0f, -40.0f, 20.0f), new Vector3(1000.0f, 31.0f, 1000.0f), Quaternion.Identity);
            cursorInstance.Create();
            shotInstance.Create();
            car1Instance1.Create(new Vector3(20.0f, 60.0f, 20.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(90.0f)));
            bridge1Instance1.Create(new Vector3(0.0f, 10.0f, 0.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(-5.0f)), 50, new Vector3(5.0f, 0.4f, 15.0f));
            bridge1Instance2.Create(new Vector3(0.0f, 10.0f, 100.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(5.0f)), 50, new Vector3(5.0f, 0.4f, 15.0f));
            ragdoll1Instance1.Create(new Vector3(0.0f, 30.0f, 100.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitX, MathHelper.DegreesToRadians(0.0f)), false, false, 1.0f);
            camera1Instance1.Create(new Vector3(0.0f, 65.0f, -22.0f), Quaternion.FromAxisAngle(Vector3.UnitX, MathHelper.DegreesToRadians(-30.0f)), Quaternion.Identity, Quaternion.Identity, true);

            lightInstance.CreateLightPoint(0, "Glass", new Vector3(-50.0f, 15.0f, 100.0f), new Vector3(0.2f, 1.0f, 1.0f), 40.0f, 1.0f);
            lightInstance.CreateLightPoint(1, "Glass", new Vector3(0.0f, 15.0f, 100.0f), new Vector3(1.0f, 0.5f, 0.1f), 40.0f, 1.0f);
            lightInstance.CreateLightPoint(2, "Glass", new Vector3(50.0f, 15.0f, 105.0f), new Vector3(1.0f, 0.7f, 0.0f), 40.0f, 1.0f);
            lightInstance.CreateLightPoint(3, "Glass", new Vector3(-50.0f, 15.0f, 45.0f), new Vector3(1.0f, 0.7f, 0.5f), 40.0f, 1.0f);
            lightInstance.CreateLightPoint(4, "Glass", new Vector3(0.0f, 15.0f, 40.0f), new Vector3(1.0f, 1.0f, 0.5f), 40.0f, 1.0f);
            lightInstance.CreateLightPoint(5, "Glass", new Vector3(50.0f, 15.0f, 35.0f), new Vector3(0.3f, 0.7f, 0.5f), 40.0f, 1.0f);
            lightInstance.CreateLightSpot(0, "Glass", new Vector3(-60.0f, 50.0f, 45.0f), new Vector3(0.1f, 0.7f, 1.0f), 40.0f, 1.0f);
            lightInstance.CreateLightSpot(1, "Glass", new Vector3(10.0f, 50.0f, 105.0f), new Vector3(1.0f, 0.5f, 0.2f), 40.0f, 1.0f);
            lightInstance.CreateLightSpot(2, "Glass", new Vector3(60.0f, 50.0f, 35.0f), new Vector3(0.5f, 1.0f, 0.2f), 40.0f, 1.0f);

            // Set controllers for objects in the scene
            SetControllers();
        }
예제 #13
0
        static void Main(string[] args)
        {
            /*Ficha10Solucao.Exercicio1();*/
            /*Ficha10Solucao.Exercicio2();*/
            /*Ficha10Solucao.Exercicio3();*/
            /*Ficha10Solucao.Exercicio4();*/
            /*Ficha10Solucao.Exercicio5();*/
            /*Ficha10Solucao.Exercicio7();*/
            /*Ficha10Solucao.Exercicio8();*/
            /*Ficha10Solucao.Exercicio10();*/
            //Ficha10Solucao.Exercicio11();
            //Ficha10Solucao.Exercicio12();
            //Ficha10Solucao.Exercicio13();
            //Ficha10Solucao.Exercicio14();
            //Ficha10Solucao.Exercicio15();
            //Ficha10Solucao.Exercicio16();

            //Ficha11Solucao.Exercicio71();
            //Ficha11Solucao.Exercicio2();
            //Ficha11Solucao.Exercicio3();
            //Ficha11Solucao.Exercicio4();
            //Ficha11Solucao.Exercicio5();
            //Ficha11Solucao.Exercicio6();
            //Ficha11Solucao.Exercicio7DoWhile();
            //Ficha11Solucao.Exercicio7While();
            //Ficha11Solucao.Exercicio7For();
            //Ficha11Solucao.Exercicio8();
            //Ficha11Solucao.Exercicio9();
            //Ficha11Solucao.Exercicio10();
            //Ficha11Solucao.Exercicio11();
            //Ficha11Solucao.Exercicio12();
            //Ficha11Solucao.Exercicio13();
            //Ficha11Solucao.Exercicio14();
            //Ficha11Solucao.Exercicio15();
            //Ficha11Solucao.Exercicio16();
            //Ficha11Solucao.Exercicio17();
            //Ficha11Solucao.Exercicio18();

            //Ficha12Solucao.Exercicio1();
            //Ficha12Solucao.Exercicio2();
            //Ficha12Solucao.Exercicio3();
            //Ficha12Solucao.Exercicio4();
            //Ficha12Solucao.Exercicio5();
            //Ficha12Solucao.Exercicio6();
            //Ficha12Solucao.Exercicio7();
            //Ficha12Solucao.Exercicio8();
            //Ficha12Solucao.Exercicio9();
            //Ficha12Solucao.Exercicio10();
            //Ficha12Solucao.Exercicio11();
            //Ficha12Solucao.Exercicio12();
            //Ficha12Solucao.Exercicio13();
            //Ficha12Solucao.Exercicio14();
            //Ficha12Solucao.Exercicio15();

            //Ficha13Solucao.Calculadora();
            //Ficha13Solucao.Forca();
            //Ficha13Solucao.PalavraRandom();

            //Ficha14Solucao.Exercicio1();
            //Ficha14Solucao.Exercicio2();
            //Ficha14Solucao.Exercicio3();
            //Ficha14Solucao.Exercicio4();
            //Ficha14Solucao.Exercicio5();
            //Ficha14Solucao.Exercicio6();

            //Ficha15Solucao.Exercicio1();
            //Ficha15Solucao.Exercicio2();
            //Ficha15Solucao.Exercicio3();
            //Ficha15Solucao.Exercicio4();
            //Ficha15Solucao.Exercicio5();
            //Ficha15Solucao.Exercicio6();
            //Ficha15Solucao.Exercicio7();
            //Ficha15Solucao.Exercicio8();
            //Ficha15Solucao.Exercicio9();

            //Ficha16Solucao.Exercicio1();
            //Ficha16Solucao.Exercicio2();
            //Ficha16Solucao.Exercicio3();
            //Ficha16Solucao.Exercicio4();
            //Ficha16Solucao.Exercicio5();
            //Ficha16Solucao.Exercicio6();
            //Ficha16Solucao.Exercicio7();
            //Ficha16Solucao.Exercicio8();

            //Ficha17Solucao.Exercicio1();
            //Ficha17Solucao.Exercicio2();
            //Ficha17Solucao.Exercicio3();
            //Ficha17Solucao.Exercicio4();
            //Ficha17Solucao.Exercicio5();
            //Ficha17Solucao.Exercicio6();
            //Ficha17Solucao.Exercicio7();

            //Testes.Testes.Summarize();

            Car p1 = new Car("Peugeut", "208", 2007);
            Car p2 = new Car("Ferrari", "FXX", 2018);

            Console.WriteLine($"{p1.GetBrand()}-{p1.GetYear()}-{p1.GetModel()}");
            Console.WriteLine($"{p2.GetBrand()}-{p2.GetYear()}-{p2.GetModel()}");

            Car1 p3 = new Car1("Peugeut", "208", 2007);
            Car1 p4 = new Car1("Ferrari", "FXX", 2018);

            Console.WriteLine($"{p3.brand} {p3.model} {p3.year}");
            Console.WriteLine($"{p4.brand} {p4.model} {p4.year}");

            Products p5 = new Products("Banana", 1.98, Types.Fruit);

            Console.WriteLine($"{p5.GetName()} - {p5.GetPrice()} - {p5.GetType()}");

            Products1 p6 = new Products1("Banana", 1.98, Types.Fruit);

            Console.WriteLine($"{p6.name} - {p6.price} - {p6.type}");

            Player1 player1 = new Player1("Renaldo", 42, 1.65f, 20, Sponsor.Nyka);

            Console.WriteLine($"{player1.GetName()} - {player1.GetAge()} - {player1.GetHeight()} - {player1.GetWeight()} - {player1.GetSponsor()} - {player1.GetIMC()}");

            Player2 player2 = new Player2("Messias", 39, 2.50f, 98, Sponsor.Acliclas);

            Console.WriteLine($"{player2.name} - {player2.age} - {player2.height} - {player2.weight} - {player2.sponsor} - {player2.imc}");
        }
예제 #14
0
        static void Main(string[] args)
        {
            Level myVar = Level.Medium;

            Console.WriteLine(myVar);
            DemoClass myObjs = new DemoClass();

            myObjs.myMethod();
            myObjs.myOtherMethod();
            Pig1 myPig1 = new Pig1();  // Create a Pig object

            myPig1.animalSound();
            Animal myAnimal = new Animal(); // Create a Animal object
            Animal myPig    = new Pig();    // Create a Pig object
            Animal myDog    = new Dog();    // Create a Dog object

            myAnimal.animalSound();
            myPig.animalSound();
            myDog.animalSound();


            Cars myCar = new Cars();

            // Call the honk() method (From the Vehicle class) on the myCar object
            myCar.honk();

            // Display the value of the brand field (from the Vehicle class) and the value of the modelName from the Car class
            Console.WriteLine(myCar.brand + " " + myCar.modelName);
            Person Obj = new Person();

            Obj.Name = "Liam";
            Console.WriteLine(Obj.Name);

            Car myObj = new Car();

            Car  myObj1 = new Car();
            Car  myObj2 = new Car();
            Car1 myObj4 = new Car1();

            myObj.color1    = "blue";
            myObj.maxSpeed1 = 300;
            Car Ford = new Car();

            Console.WriteLine(Ford.model);
            Ford.model  = "Mustang";
            Ford.color1 = "yellow";
            Ford.year   = 1969;

            Car Opel = new Car();

            Opel.model  = "Astra";
            Opel.color1 = "white";
            Opel.year   = 2005;

            myObj.fullThrottle();  // Call the method



            Console.WriteLine(Ford.model);
            Console.WriteLine(Opel.model);
            Console.WriteLine(myObj.color1);
            Console.WriteLine(myObj.maxSpeed1);
            Console.WriteLine(myObj4.color);
            Console.WriteLine(myObj1.color);
            Console.WriteLine(myObj2.color);
            Console.WriteLine(myObj.color);
            Console.WriteLine(myObj.maxSpeed);
            try
            {
                int[] myNumbers = { 1, 2, 3 };
                Console.WriteLine(myNumbers[10]);
            }
            catch (Exception e)
            {
                Console.WriteLine("Something went wrong.");
            }
            finally
            {
                Console.WriteLine("The 'try catch' is finished.");
            }
        }
예제 #15
0
 // Start is called before the first frame update
 void Start()
 {
     _gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
     _c1          = GameObject.Find("Car1").GetComponent <Car1>();
     _c2          = GameObject.Find("Car2").GetComponent <Car2>();
 }
예제 #16
0
        public void Create()
        {
            string sceneInstanceIndexName = name + instanceIndexName;

            if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null)
            {
                return;
            }

            scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName);

            // Initialize maximum number of solver iterations for the scene
            scene.MaxIterationCount = 10;

            // Initialize time of simulation for the scene
            scene.TimeOfSimulation = 1.0f / 15.0f;

            Initialize();

            // Initialize objects in the scene
            skyInstance1.Initialize(scene);
            cursorInstance.Initialize(scene);
            shotInstance.Initialize(scene);
            terrainInstance1.Initialize(scene);
            lakeInstance1.Initialize(scene);
            defaultShapesInstance.Initialize(scene);
            columnInstance1.Initialize(scene);
            columnInstance2.Initialize(scene);
            pierInstance1.Initialize(scene);
            ragdoll2Instance1.Initialize(scene);
            boat1Instance1.Initialize(scene);
            car1Instance1.Initialize(scene);
            box2Instance1.Initialize(scene);
            crab1Instance1.Initialize(scene);
            torusMesh.Initialize(scene);
            camera2Instance1.Initialize(scene);
            lightInstance.Initialize(scene);

            // Initialize controllers in the scene
            skyDraw1Instance1.Initialize(scene);
            cursorDraw1Instance.Initialize(scene);
            boat1Animation1Instance1.Initialize(scene);
            car1Animation1Instance1.Initialize(scene);
            terrainDraw1Instance1.Initialize(scene);
            lakeDraw1Instance1.Initialize(scene);
            camera2Animation1Instance1.Initialize(scene);
            camera2Draw1Instance1.Initialize(scene);

            // Create shapes shared for all physics objects in the scene
            // These shapes are used by all objects in the scene
            Demo.CreateSharedShapes(demo, scene);

            // Create shapes for objects in the scene
            Sky.CreateShapes(demo, scene);
            Cursor.CreateShapes(demo, scene);
            Shot.CreateShapes(demo, scene);
            //terrainInstance1.CreateShapes(demo, scene, 0.0f, false);
            //lakeInstance1.CreateShapes(demo, scene, 2, 2, 50.0f, 0.95f, 0.04f, 0.04f, 0.5f, 1.0f, 1.0f, 0.2f, 1.0f, 0.0f, false);
            terrainInstance1.CreateShapes(demo, scene, 0.0f, true);
            lakeInstance1.CreateShapes(demo, scene, 150, 150, 50.0f, 0.95f, 0.04f, 0.04f, 0.5f, 1.0f, 1.0f, 0.2f, 1.0f, 0.0f, true);
            DefaultShapes.CreateShapes(demo, scene);
            Column.CreateShapes(demo, scene);
            Pier.CreateShapes(demo, scene);
            Ragdoll2.CreateShapes(demo, scene);
            Boat1.CreateShapes(demo, scene);
            Car1.CreateShapes(demo, scene);
            Box2.CreateShapes(demo, scene);
            Crab1.CreateShapes(demo, scene);
            TorusMesh.CreateShapes(demo, scene);
            Camera2.CreateShapes(demo, scene);
            Lights.CreateShapes(demo, scene);

            // Create physics objects for objects in the scene
            skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f));
            cursorInstance.Create();
            shotInstance.Create();
            terrainInstance1.Create(new Vector3(-316.0f, -128.0f, -2072.0f), new Vector3(32.0f, 256.0f, 32.0f), Quaternion.Identity, 0.0f);
            //lakeInstance1.Create(new Vector3(-316.0f, -100.0f, -2072.0f), new Vector3(2400.0f, 1.0f, 2400.0f), Quaternion.Identity, 0.0f);
            lakeInstance1.Create(new Vector3(-316.0f, -100.0f, -2072.0f), new Vector3(4.0f, 1.0f, 4.0f), Quaternion.Identity, 0.0f);
            defaultShapesInstance.Create();
            columnInstance1.Create(new Vector3(10.0f, 30.0f, 20.0f), Vector3.One, Quaternion.Identity, "Box", 4, new Vector3(4.0f, 2.0f, 8.0f), 1.0f, true, 0.1f, 0.05f);
            columnInstance2.Create(new Vector3(20.0f, 30.0f, 20.0f), Vector3.One, Quaternion.Identity, "Box", 5, new Vector3(8.0f, 8.0f, 8.0f), 1.0f, true, 0.1f, 0.05f);
            pierInstance1.Create(new Vector3(0.0f, 0.0f, 100.0f), Vector3.One, Quaternion.Identity);
            ragdoll2Instance1.Create(new Vector3(-10.0f, -50.0f, 70.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitX, MathHelper.DegreesToRadians(45.0f)), false, false, 1.0f);
            boat1Instance1.Create(new Vector3(0.0f, -5.0f, 0.0f), Vector3.One, Quaternion.Identity);
            car1Instance1.Create(new Vector3(-80.0f, -70.0f, 20.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(-115.0f)));
            box2Instance1.Create(new Vector3(-20.0f, 0.0f, 40.0f), Vector3.One, Quaternion.Identity, 4, new Vector3(1.0f, 4.0f, 0.1f), 0.02f);
            crab1Instance1.Create(new Vector3(-90.0f, -75.0f, -40.0f), new Vector3(0.5f, 0.5f, 0.5f), Quaternion.FromAxisAngle(Vector3.UnitX, MathHelper.DegreesToRadians(180.0f)));
            torusMesh.Create(new Vector3(10.0f, 20.0f, 50.0f), Vector3.One, Quaternion.Identity, 100000.0f);
            camera2Instance1.Create(new Vector3(50.0f, 5.0f, 40.0f), Quaternion.Identity, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(-220.0f)), Quaternion.Identity, true);

            lightInstance.CreateLightPoint(0, "Glass", new Vector3(-120.0f, -97.0f, -140.0f), new Vector3(0.1f, 0.9f, 0.2f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(1, "Glass", new Vector3(-70.0f, -97.0f, -200.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(2, "Glass", new Vector3(-90.0f, -97.0f, -100.0f), new Vector3(0.0f, 0.7f, 0.8f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(3, "Glass", new Vector3(70.0f, -97.0f, -180.0f), new Vector3(1.0f, 0.4f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(4, "Glass", new Vector3(10.0f, -97.0f, -160.0f), new Vector3(0.2f, 0.7f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(5, "Glass", new Vector3(40.0f, -97.0f, -140.0f), new Vector3(0.4f, 0.6f, 1.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(6, "Glass", new Vector3(-40.0f, -95.0f, -190.0f), new Vector3(1.0f, 0.9f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(7, "Glass", new Vector3(-40.0f, -95.0f, -140.0f), new Vector3(0.5f, 0.7f, 0.1f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(8, "Glass", new Vector3(-40.0f, -85.0f, -90.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(9, "Glass", new Vector3(-10.0f, -95.0f, -190.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(10, "Glass", new Vector3(-10.0f, -95.0f, -140.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(11, "Glass", new Vector3(-10.0f, -85.0f, -90.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(12, "Glass", new Vector3(-40.0f, -85.0f, -290.0f), new Vector3(0.5f, 0.7f, 0.1f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(13, "Glass", new Vector3(-40.0f, -95.0f, -240.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(14, "Glass", new Vector3(-10.0f, -85.0f, -290.0f), new Vector3(1.0f, 0.9f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(15, "Glass", new Vector3(-10.0f, -95.0f, -240.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(16, "Glass", new Vector3(-60.0f, -69.0f, 20.0f), new Vector3(0.6f, 0.8f, 0.2f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(17, "Glass", new Vector3(-20.0f, -55.0f, 45.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(18, "Glass", new Vector3(10.0f, -72.0f, -20.0f), new Vector3(0.8f, 0.7f, 0.2f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(19, "Glass", new Vector3(25.0f, -55.0f, 25.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightSpot(0, "Glass", new Vector3(0.0f, -65.0f, 0.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f);
            lightInstance.CreateLightSpot(1, "Glass", new Vector3(-5.0f, -55.0f, 40.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f);

            // Set controllers for objects in the scene
            SetControllers();
        }
예제 #17
0
    // Update is called once per frame
    void Update()
    {
        //すべての車の位置を取得
        float mx = this.transform.position.x;

        GameObject[] cars = GameObject.FindGameObjectsWithTag("Car");
        int          flag = 0;

        foreach (GameObject obs in cars)
        {
            float tx = obs.transform.position.x;
            if (tx > mx && tx - mx < 11 &&
                (obs.transform.position.z - this.transform.position.z) * (obs.transform.position.z - this.transform.position.z) < 6.25f)
            {
                flag = 1;
                break;
            }
        }
        if (flag == 1)
        {
            dx = dx - 0.1f;
        }
        else
        {
            dx = dx + 0.1f;
        }

        //合流
        int flag1 = 0;

        near = 0;
        if (type == 2)
        {
            foreach (GameObject obs in cars)
            {
                Car1  c  = obs.GetComponent <Car1> ();
                float tx = obs.transform.position.x;
                if (c.type == 1)
                {
                    if ((mx - tx) * (mx - tx) < 160)
                    {
                        flag1 = 1;
                        break;
                    }
                }
                if (c.type == 2)
                {
                    if (tx - mx > 0)
                    {
                        near = 1;
                    }
                }
            }
            //運転技術が高い車は,車線変更できるように減速する
            if (flag1 == 1 && mx > 100.0f && flag == 0)
            {
                dx = 0.4f;
            }
            //車線変更可能なとき
            //マナーの悪い車は,前の車がいても車線変更をする
            if (flag1 == 0 && mx > 100.0f && (near == 0 || skill == 2))
            {
                type   = 1;
                henkou = 1;
                cnt    = 20;
            }
            //限界まで来たら停止する
            if (this.transform.position.x > 140)
            {
                dx = 0.0f;
            }
        }

        //車線変更処理
        if (henkou == 1)
        {
            this.transform.position -= new Vector3(0.0f, 0.0f, 0.25f);
            cnt--;
            if (cnt < 0)
            {
                henkou = 0;
            }
        }

        //移動処理
        if (dx < 0.0f)
        {
            dx = 0.0f;
        }
        if (dx > max_speed)
        {
            dx = max_speed;
        }
        this.transform.position += new Vector3(dx, 0.0f, 0.0f);

        //もし,範囲外になったら削除
        if (this.transform.position.x > 300)
        {
            Destroy(gameObject);
        }
    }
예제 #18
0
        static void Main(string[] args)
        {
            Car1 c1 = new Car1("Chevy", "Equanox", "2015", 20000);

            Console.WriteLine("How many cars would you like to enter?");
            int size = int.Parse(Console.ReadLine());

            List <Cars> cars = new List <Cars>();

            Cars.Add(new Cars()
            {
                MAKE = "Chevy", MODEL = "Equanox", YEAR = "2000", PRICE = 2599
            });
            Cars.Add(new Cars()
            {
                MAKE = "Ford", MODEL = "Edge", YEAR = "2020", PRICE = 2599
            });
            Cars.Add(new Cars()
            {
                MAKE = "GM", MODEL = "Terrain", YEAR = "1998", PRICE = 2599
            });
            UsedCar.Add(new UsedCar()
            {
                MAKE = "Plymouth", MODEL = "Acclaim", YEAR = "1934", PRICE = 2599, MILEAGE = 343000
            });
            UsedCar.Add(new UsedCar()
            {
                MAKE = "Jeep", MODEL = "Wrangler", YEAR = "1994", PRICE = 2599, MILEAGE = 145000
            });
            UsedCar.Add(new UsedCar()
            {
                MAKE = "Saturn", MODEL = "SL1", YEAR = "1999", PRICE = 2599, MILEAGE = 237000
            });
            // used to add new cars to the list

            while (true)
            #region User Input Car Info
            {
                //Cars temp = new Cars();
                Console.WriteLine("Please provide the make");
                string MAKE = Console.ReadLine();


                Console.WriteLine("Please provide the car model");
                string MODEL = Console.ReadLine();


                Console.WriteLine("Please provide car year");
                string YEAR = (Console.ReadLine());


                Console.WriteLine("Please provide the MSRP");
                int PRICE = int.Parse(Console.ReadLine());

                Cars temp = new Cars(MAKE, MODEL, YEAR, PRICE); ////practice this ***************************

                cars.Add(temp);                                 // add the temp object to cars list

                Console.WriteLine("do you want to add another vehicle?");
                string choice = Console.ReadLine();
                if (choice == "n")
                {
                    break;
                }
                #endregion
                #region Print Each Car Info
            }

            foreach (Cars c in cars)
            {
                Console.WriteLine("Make: " + c.MAKE);
                Console.WriteLine("Model: " + c.MODEL);
                Console.WriteLine("Year: " + c.YEAR);
                Console.WriteLine("Price:" + c.PRICE);
                Console.WriteLine("========================");
            }
            #endregion

            #region //Reference Comments//(ignore)
            //REFERENCE COMMENTS:
            //Console.WriteLine(john.FirstName);   // will display          John
            //john.Salary = 50000;
            //john.Salary = john.Salary + 10000;
            //Console.WriteLine(john.Salary);
            //Console.WriteLine(john.SSN); // blank if unassigned, default filled in.
            //Employee jacob = new Employee();
            //jacob.FirstName = "Jacob";
            //jacob.LastName = "Snover";
            //jacob.Salary = 250000;
            #endregion
        }
예제 #19
0
        public void Create()
        {
            string sceneInstanceIndexName = name + instanceIndexName;

            if (demo.Engine.Factory.PhysicsSceneManager.Find(sceneInstanceIndexName) != null)
            {
                return;
            }

            scene = demo.Engine.Factory.PhysicsSceneManager.Create(sceneInstanceIndexName);

            // Initialize maximum number of solver iterations for the scene
            scene.MaxIterationCount = 10;

            // Initialize time of simulation for the scene
            scene.TimeOfSimulation = 1.0f / 15.0f;

            Initialize();

            // Initialize objects in the scene
            skyInstance1.Initialize(scene);
            quadInstance1.Initialize(scene);
            cursorInstance.Initialize(scene);
            shotInstance.Initialize(scene);
            plant2Instance1.Initialize(scene);
            building1Instance1.Initialize(scene);
            car1Instance1.Initialize(scene);
            ragdoll3Instance1.Initialize(scene);
            box1Instance1.Initialize(scene);
            lamp1Instance1.Initialize(scene);
            lamp1Instance2.Initialize(scene);
            camera2Instance1.Initialize(scene);
            lightInstance.Initialize(scene);

            // Initialize controllers in the scene
            skyDraw1Instance1.Initialize(scene);
            cursorDraw1Instance.Initialize(scene);
            car1Animation1Instance1.Initialize(scene);
            lamp1Animation1Instance1.Initialize(scene);
            lamp1Animation1Instance2.Initialize(scene);
            camera2Animation1Instance1.Initialize(scene);
            camera2Draw1Instance1.Initialize(scene);

            // Create shapes shared for all physics objects in the scene
            // These shapes are used by all objects in the scene
            Demo.CreateSharedShapes(demo, scene);

            // Create shapes for objects in the scene
            Sky.CreateShapes(demo, scene);
            Quad.CreateShapes(demo, scene);
            Cursor.CreateShapes(demo, scene);
            Shot.CreateShapes(demo, scene);
            Plant2.CreateShapes(demo, scene);
            Building1.CreateShapes(demo, scene);
            Car1.CreateShapes(demo, scene);
            Ragdoll3.CreateShapes(demo, scene);
            Box1.CreateShapes(demo, scene);
            Lamp1.CreateShapes(demo, scene);
            Camera2.CreateShapes(demo, scene);
            Lights.CreateShapes(demo, scene);

            // Create physics objects for objects in the scene
            skyInstance1.Create(new Vector3(0.0f, 0.0f, 0.0f));
            quadInstance1.Create(new Vector3(0.0f, -40.0f, 20.0f), new Vector3(1000.0f, 31.0f, 1000.0f), Quaternion.Identity);
            cursorInstance.Create();
            shotInstance.Create();
            plant2Instance1.Create(new Vector3(-30.0f, -9.0f, 20.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(10.0f)));
            building1Instance1.Create(new Vector3(0.0f, 0.0f, 100.0f), Vector3.One, Quaternion.Identity);
            car1Instance1.Create(new Vector3(10.0f, 0.0f, 40.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitY, MathHelper.DegreesToRadians(180.0f)));
            ragdoll3Instance1.Create(new Vector3(-10.0f, -10.0f, 0.0f), Vector3.One, Quaternion.FromAxisAngle(Vector3.UnitX, MathHelper.DegreesToRadians(0.0f)), false, false, 0.5f);
            box1Instance1.Create(new Vector3(40.0f, 0.0f, 50.0f), Vector3.One, Quaternion.Identity, 4, new Vector3(1.0f, 4.0f, 0.1f), 0.02f);
            lamp1Instance1.Create(new Vector3(-96.0f, 5.0f, 140.0f), Vector3.One, Quaternion.Identity, PhysicsScene.Factory.PhysicsObjectManager.Find("Building 1 Level 1 Wall 3 1"));
            lamp1Instance2.Create(new Vector3(-96.0f, 5.0f, 220.0f), Vector3.One, Quaternion.Identity, PhysicsScene.Factory.PhysicsObjectManager.Find("Building 1 Level 1 Wall 3 1"));
            camera2Instance1.Create(new Vector3(0.0f, 5.0f, -22.0f), Quaternion.Identity, Quaternion.Identity, Quaternion.Identity, true);

            lightInstance.CreateLightPoint(0, "Glass", new Vector3(-30.0f, -3.0f, 90.0f), new Vector3(1.0f, 0.7f, 0.5f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(1, "Glass", new Vector3(0.0f, -3.0f, 90.0f), new Vector3(0.3f, 0.7f, 0.2f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(2, "Glass", new Vector3(30.0f, -3.0f, 90.0f), new Vector3(0.3f, 0.7f, 0.5f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(3, "Glass", new Vector3(-20.0f, -3.0f, 20.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(4, "Glass", new Vector3(20.0f, -3.0f, 10.0f), new Vector3(1.0f, 1.0f, 0.5f), 20.0f, 1.0f);
            lightInstance.CreateLightPoint(5, "Glass", new Vector3(30.0f, -3.0f, 40.0f), new Vector3(1.0f, 0.7f, 0.0f), 20.0f, 1.0f);
            lightInstance.CreateLightSpot(0, "Glass", new Vector3(-30.0f, -3.0f, 15.0f), new Vector3(0.1f, 0.7f, 1.0f), 20.0f, 1.0f);
            lightInstance.CreateLightSpot(1, "Glass", new Vector3(0.0f, 8.0f, 20.0f), new Vector3(1.0f, 0.5f, 0.2f), 20.0f, 1.0f);
            lightInstance.CreateLightSpot(2, "Glass", new Vector3(45.0f, 0.0f, 45.0f), new Vector3(0.5f, 1.0f, 0.2f), 20.0f, 1.0f);

            // Set controllers for objects in the scene
            SetControllers();
        }
예제 #20
0
        static void Main(string[] args)
        {
            Character warrior        = new Character("Human"); //У каждого класса свое предназначение, Класс кошка не может создавать ракеты...
            string    charactierInfo = warrior.GetRace();

            warrior.Hit(35);
            Console.WriteLine($"Ваша раса: {charactierInfo}, Здоровье персонажа: {warrior.GetHealth()}, Броня: {warrior.armor}");

            Character archer    = new Character("Wood Elf", 60);
            int       armorInfo = archer.armor;

            Console.WriteLine($"Ваша раса: {archer.GetRace()}, Здоровье персонажа: {archer.GetHealth()}, Броня: {armorInfo}");


            Calculator calc   = new Calculator();
            double     result = calc.SqrtLength(ab: 8, bc: 12, alpha: 45); //Именованные аргументы Ctrl + .(точка). Выбираем add argument ->

            result = Math.Round(value: result, digits: 2);
            Console.WriteLine("Площадь равна: " + result);

            double avg = calc.Average(numbers: new int[] { 1, 2, 3, 4 }); //инициализация массива Average (именованные аргументы)

            Console.WriteLine("Среднее значение: " + avg);
            //С помощью params можно передавать значения массива через запятую
            double avg2 = calc.Average2(1, 2, 3, 4);   //инициализация массива Average.

            Console.WriteLine("Инициализация среднего значения: " + avg2);


            //  Calculator.TryParsed(); //С использованием статического метода, без использования экземпляра


            Calculator divider = new Calculator();

            if (divider.TryDevide(5, 2, out double result2))
            {
                Console.WriteLine($"Результат деления равен: {result2}");
            }
            else
            {
                Console.WriteLine("Fail не получилось поделить");
            }

            //Создадим экземпляр структуры
            PointVal a; //это экземпляр структуры, тоже самое, что и PointVal a = new PointWal();

            a.x = 5;
            a.y = 8;

            //Создадим еще одну структуру b
            PointVal b = a;

            b.x = 4;
            b.y = 6;

            a.LogValues();
            b.LogValues();


            Console.WriteLine("Данные после struct (структуры)");
            //Создадим Экземпляр для класса

            PointRef c = new PointRef();

            c.x = 5;
            c.y = 8;

            //Создадим еще одну структуру b
            PointRef d = c;

            d.x = 4;
            d.y = 6;

            c.LogValues();
            d.LogValues();

            List <int> list = new List <int>();

            AddNumbers(list);
            foreach (int value in list)
            {
                Console.WriteLine("Вывод List " + value);
            }

            Swap(8, 6);
            //      SwapAuto(); //Значения вводит пользователь
            //     SwapFromFull(); //С защитой от дурака

            //Bankomat наследование inheritence
            ModelA terminalA = new ModelA(252);

            terminalA.Connect();
            ModelB terminalB = new ModelB(758);

            terminalB.Connect();

            //Car наследование
            Car1 bmw = new Car1("Bmw", "Black", 2.6, 289.7);

            bmw.CarInfo();
            Car2 dodge = new Car2("Dodge", "Yellow", 6.0, 382.3);

            dodge.CarInfo();

            Console.WriteLine();

            //Полиформизм (1 метод для каждого класса осуществляет свою операцию папка Polymorphism)
            Rectangle rectangle = new Rectangle(width: 17.5, height: 22.3);

            rectangle.Area();
            rectangle.Perimeter();
            rectangle.Draw();

            Console.WriteLine();

            Triangle triangle = new Triangle(a: 5.2, b: 6.3, c: 7.5);

            triangle.Area();
            triangle.Perimeter();
            triangle.Draw();
            Console.WriteLine();
            Console.WriteLine();

            /*Так как мы переопределили все эти методы, вызывающий код может унифицированно работать со всеми этими типами/классами
             * используя базовый класс/абстрактный, записать экземпляр абстрактного класса можно в виде массива и передать туда наши
             * классы - наследники в этот массив*/
            Shapes[] shapes = new Shapes[2];
            shapes[0] = new Triangle(6.3, 8.2, 9.7);
            shapes[1] = new Rectangle(22.4, 18.7);
            //Пройдемся foreach, используя базовый(абстрактный класс)
            foreach (var shape in shapes)
            {
                shape.Area();
                shape.Draw();
                shape.Perimeter();
            }
            Console.WriteLine();
            Console.WriteLine();
            Do(triangle);

            MyStack <int> ms = new MyStack <int>(); //у нас 2 перегрузки массива (по умолчанию 4 элемента), либо выбрать размер какой необходим

            ms.Push(1);
            ms.Push(2);
            ms.Push(3);
            Console.WriteLine(ms.Peek()); //Выведем последний добавленный элемент
            ms.Pop();                     //удалим последний элемент
            Console.WriteLine(ms.Peek());
            ms.Push(3);
            ms.Push(4);
            ms.Push(5); //чтобы произошло расширение стека, чтобы убедиться, что ничего не падает
            Console.WriteLine(ms.Peek());

            //Вадим Шванов
            ShvanovCar shamovCar = new ShvanovCar();

            shamovCar.CarInfo();
            ShvanovCar shCar = new ShvanovCar("F1", 260);

            shCar.CarInfo();

            RandomNumbers();
        }