コード例 #1
0
        public void polymorphMove()
        {
            Crate crate = new Crate(currentField);
            Truck truck = new Truck(currentField);
            Wall  wall  = new Wall();

            wall.Move(Direction.Right);
            crate.Move(Direction.Right);
            truck.Move(Direction.Right);
        }
コード例 #2
0
 public void MoveTruck(ConsoleKey ck)
 {
     if (ck == ConsoleKey.RightArrow || ck == ConsoleKey.LeftArrow || ck == ConsoleKey.DownArrow || ck == ConsoleKey.UpArrow)
     {
         Truck.Move(ck);
         if (Employee != null)
         {
             Employee.Move(ck);
         }
     }
 }