public Faucet() { Table wine = new Table(); Hinge book = new Hinge(); wine.Set(book); book.Set(wine); wine.Lamp(10); book.garden.Lamp("z powrotem za"); book.bulb *= 2; wine.Lamp("minut"); wine.Lamp(book); }
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); } }
public void Set(Hinge b) { floor = b; }