Sleep() 공개 메소드

public Sleep ( ) : void
리턴 void
예제 #1
0
        static void Main()
        {
            Worker worker1 = new Employee("123");

            worker1.Work(2);

            Worker worker2 = new Robot("111", 1);

            worker2.Work(2);

            Employee employee = new Employee("321");

            employee.Sleep();
            employee.Work(3);

            Robot robot = new Robot("222", 2);

            robot.Work(3);
            Console.WriteLine(robot.Capacity);
            Console.WriteLine(robot.CurrentPower);
            robot.Recharge();
            Console.WriteLine(robot.Capacity);
            Console.WriteLine(robot.CurrentPower);
            robot.Work(1);
            Console.WriteLine(robot.Capacity);
            Console.WriteLine(robot.CurrentPower);
            robot.Work(4);
            Console.WriteLine(robot.Capacity);
            Console.WriteLine(robot.CurrentPower);
        }
예제 #2
0
        static void Main()
        {
            Employee employee = new Employee("32");
            Robot    robot    = new Robot("34", 5);

            employee.Sleep();
            robot.Work(55);
        }
예제 #3
0
        static void Main()
        {
            ISleeper      worker = new Employee("ID");
            IRechargeable robot  = new Robot("ID", 42);

            worker.Sleep();
            robot.Recharge();
        }
예제 #4
0
        static void Main()
        {
            Robot rob = new Robot("12345Robby", 10);

            rob.Recharge();
            rob.Work(3);
            Employee ben = new Employee("1234BENNY");

            ben.Sleep();
            ben.Work(3);
        }
예제 #5
0
        static void Main()
        {
            Employee employee = new Employee("Viktor");

            Robot robot = new Robot("Z3434342", 20);

            employee.Work(8);

            employee.Sleep();

            robot.Recharge();

            robot.Work(16);
        }