Пример #1
0
        static void Main(string[] args)
        {
            //Gamer gamer = new Gamer("Игрок 1", new DateTime(1983, 12, 4, 21, 2, 14));

            //Gamer[] gamers = new Gamer[100];
            //for (var i = 0; i < gamers.Length; i++)
            //{
            //    var g = new Gamer(string.Format("Gamer {0}", i + 1), DateTime.Now.Subtract(TimeSpan.FromDays(365 * (i + 18))));
            //    gamers[i] = g;
            //}

            //gamer.SayYouName();

            //Console.WriteLine();

            //foreach (var g in gamers)
            //    g.SayYouName();

            //Console.WriteLine();

            ////gamer.SetName("2123");
            ////Console.WriteLine("Имя игрока {0}", gamer.GetName());

            //gamer.Name = "123";

            //Console.WriteLine("Игрок {0}", gamer.Name);


            //var space_ship = new SpaceShip(new Vector2D(5, 7));
            //var space_ship2 = space_ship;
            //space_ship.Position = new Vector2D(150, -210);

            //var v1 = new Vector2D(1, 8);
            //var v2 = v1;
            //v1.X = 7;
            //v1.Y = -14;

            //var v3 = v1 + v2;
            //var v4 = v1 - v2;

            //var v5 = v4 + 7;
            //var v6 = -v5;

            Printer printer = new Printer();

            printer.Print("Hello World!");

            printer = new PrefixPrinter(">>>>>");

            printer.Print("Hello World!");

            printer = new DateTimeLogPrinter();

            printer.Print("Hello World!");

            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            //Gamer gamer = new Gamer("Игрок 1", new DateTime(1987, 6, 16, 3, 15, 35));

            //Gamer[] gamers = new Gamer[100];
            //for (var i = 0; i < gamers.Length; i++)
            //{
            //    var g = new Gamer(string.Format("Gamer {0}", i + 1), DateTime.Now.Subtract(TimeSpan.FromDays(365 * (i + 18))));
            //    //g.Name = $"Gamer {i + 1}";
            //    gamers[i] = g;
            //}

            //gamer.SayYourName();


            //Console.WriteLine();

            //foreach (var g in gamers)
            //{
            //    g.SayYourName();
            //}

            ////gamer.SetName("Dubsent");
            ////Console.WriteLine("Имя игрока {0}", gamer.GetName());

            //gamer.Name = "BowWow";
            //Console.WriteLine("Игрок {0}", gamer.Name);

            //var space_ship = new SpaceShip(new Vector2D(5, 7));
            //var space_ship2 = space_ship;
            //space_ship.Position = new Vector2D(150, -210);

            //var v1 = new Vector2D(1, 8);
            //var v2 = v1;
            //v1.X = 7;
            //v1.Y = -14;
            //var v3 = v1 + v2;
            //var v4 = v2 - v1;
            //var v5 = v4 + 7;
            //var v6 = -v5;

            var printer = new Printer();

            printer.Print("What's your name?");

            printer = new PrefixPrinter(">>>>>");
            printer.Print("WOW! What's going on?!");

            printer = new DateTimeLogPrinter();
            printer.Print("Hello World!");

            printer = new FilePrinter("test");
            printer.Print("WOW! What's going on?!");

            Console.ReadLine();
        }
Пример #3
0
        static void Main(string[] args) // Ctrl+K,D
        {
            //Player player1 = new Player();
            //player1.Name = "Иванов";
            //player1.Birthday = new DateTime(1974, 12, 21, 0, 0, 0);

            //Player player1 = new Player("Empty", new DateTime(1987, 12, 12));

            //Console.Write("Введите фамилию >");
            //player1.Name = Console.ReadLine();

            //Console.WriteLine(player1.Name);

            //Vector2D v1 = new Vector2D(5, 7);
            //Vector2D v2 = new Vector2D(-7, 2);

            //Vector2D v3 = v1 + v2;

            //Vector2D v4 = v3 + 3.14159265358979;

            //CultureInfo ru = new CultureInfo("ru-ru");
            //CultureInfo en_us = new CultureInfo("en-us");
            //CultureInfo invariant = CultureInfo.InvariantCulture;
            //CultureInfo current = CultureInfo.CurrentCulture;
            //CultureInfo current_ui = CultureInfo.CurrentUICulture;

            //double pi = double.Parse("3.1415", invariant); //Convert.ToDouble("3,1415");
            ////int j = Convert.ToInt32(3.14);
            //int i = (int)pi;

            //Console.WriteLine(pi);

            //double length = v4;

            Printer       printer        = new Printer();
            PrefixPrinter prefix_printer = new PrefixPrinter();

            prefix_printer.Prefix = "!!!!!!!-------!!!!!!!";

            prefix_printer.Print("QWE");

            printer.Print("Hello World!");
            prefix_printer.PrintData(3.14);

            printer.Print("123");

            printer = prefix_printer;

            Printer printer1 = new PrefixPrinter();

            printer.Print("345");
            printer1.Print("678");

            Console.ReadLine();
        }
Пример #4
0
        static void Main(string[] args)//Ctrl+K,D
        {
            //Player player0 = null;
            //Player player1 = new Player();
            //player1.Name = "Иванов";
            //player1.Birthday = new DateTime(1977, 03, 23, 9, 0, 0);
#if false
            Console.Write("Введите фамилию >");
            var surname = Console.ReadLine();

            Player player1 = new Player(surname, new DateTime(1977, 03, 23, 9, 0, 0));

            Console.WriteLine(player1.GetName());
            Console.WriteLine(player1.Name);
#endif

#if false
            var v1 = new Vector2D(5, 7);
            var v2 = new Vector2D(-7, 2);
            var v3 = v1 + v2;
            var v4 = v3 + 3.1459265358979;

            CultureInfo ru    = new CultureInfo("ru-ru");
            CultureInfo en_us = new CultureInfo("en-us");

            double pi = double.Parse("3.1459265358979", en_us);
            int    i  = (int)pi;

            double lenght = v4;
#endif
            Printer       printer       = new Printer();
            PrefixPrinter prefixPrinter = new PrefixPrinter();
            prefixPrinter.Prefix = "!!!!!!!-------!!!!!!!";
            prefixPrinter.Print("QWE");

            printer.Print("Hello World!");
            prefixPrinter.PrintData(3.14);

            printer.Print("123");

            printer = prefixPrinter;

            Printer printer1 = new PrefixPrinter();

            printer.Print("345");
            printer1.Print("678");

            Console.ReadLine();
        }