示例#1
0
文件: Program.cs 项目: polinskaya/9
        static void Main(string[] args)
        {
            Technique     technique     = new Technique(100);
            SemiTechnique semiTechnique = new SemiTechnique(30, 100);

            Boss.Upgrade(technique.AddVoltage100);

            technique.TurnOn(500);

            Boss.Upgrading += semiTechnique.AddVoltage100;
            semiTechnique.TurnOn(100, 350);

            semiTechnique.TurnOn(100, 350);

            String str = "Лабораторная,.,   ,,,номер:! 9;...?";

            StringOperation stringOperation = null;

            stringOperation += DeletePunctuationMark;
            stringOperation += FerstToApperCase;
            stringOperation += AddDote;
            stringOperation += AddAuthor;

            Action_ColorPrint(ref str, CorrectString);

            Console.ReadLine();
        }
示例#2
0
        public static void TurnOn(this SemiTechnique obj, int voltM, int voltT)
        {
            Upgrading += obj.AddVoltage50;
            Upgrading += () =>
            {
                Console.WriteLine("Человек(выносливость): Увеличено на 15");
                return(obj.AllowableVoltageMen += 15);
            };

            if (obj.AllowableVoltageTechnuque < voltT || obj.AllowableVoltageMen < voltM)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Напряжение велико,процесс улучшения..");
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Blue;
            }

            while (obj.AllowableVoltageTechnuque < voltT || obj.AllowableVoltageMen < voltM && Upgrading != null)
            {
                if (obj.AllowableVoltageTechnuque >= voltT)
                {
                    Upgrading -= obj.AddVoltage50;
                    Upgrading -= obj.AddVoltage100;
                }

                Upgrading?.Invoke();
            }

            Console.WriteLine("Включено");
            Console.ResetColor();
            Console.WriteLine();

            Upgrading = null;
        }