예제 #1
0
 public Faucet()
 {
     Table wine = new Table();
     Hinge book = new Hinge();
     wine.Set(book);
     book.Set(wine);
     wine.Lamp(10);
     book.garden.Lamp("back in");
     book.bulb *= 2;
     wine.Lamp("minutes");
     wine.Lamp(book);
 }
예제 #2
0
파일: Faucet.cs 프로젝트: nohe427/HeadFirst
        public Faucet()
        {
            Table wine = new Table();
            Hinge book = new Hinge();

            wine.Set(book);
            book.Set(wine);
            wine.Lamp(10);
            book.garden.Lamp("back in");
            book.bulb *= 2;
            wine.Lamp("minutes");
            wine.Lamp(book);
        }
예제 #3
0
 public void Lamp(object oil)
 {
     if (oil is int)
     {
         floor.bulb = (int)oil;
     }
     else if (oil is string)
     {
         stairs = (string)oil;
     }
     else if (oil is Hinge)
     {
         Hinge vine = oil as Hinge;
         Console.WriteLine(vine.Table()
                           + " " + floor.bulb + " " + stairs);
     }
 }
예제 #4
0
 public void Set(Hinge b)
 {
     floor = b;
 }
예제 #5
0
 public void Set(Hinge b)
 {
     floor = b;
 }