Пример #1
0
 public House()
 {
     basement = new Basement();
     walls    = new Wall[4];
     for (int i = 0; i < 4; i++)
     {
         walls[i] = new Wall();
     }
     roof    = new Roof();
     door    = new Door();
     windows = new Window[4];
     for (int i = 0; i < 4; i++)
     {
         windows[i] = new Window();
     }
 }
Пример #2
0
 public House()
 {
     Building    = new IPart[5][];
     Building[0] = new Basement[1] {
         new Basement()
     };
     Building[1] = new Wall[4] {
         new Wall(), new Wall(), new Wall(), new Wall()
     };
     //for (int i = 0; i < 4; i++) Building[1][i] = new Wall(); // we also may initialize like this
     Building[2] = new Door[1] {
         new Door()
     };
     Building[3] = new Window[4] {
         new Window(), new Window(), new Window(), new Window()
     };
     Building[4] = new Roof[1] {
         new Roof()
     };
 }
Пример #3
0
 public void FinishBuildBasement(Basement basement)
 {
     basement.IsBuilt = true;
     Console.WriteLine("{0} built the basement", Name);
 }