Пример #1
0
 // Builds constructor.
 // Takes one parameter,
 // an object from the class Path.
 // Constructor is called as soon
 // as an object(instance) of the
 // class is declared.
 public ResurrectingInvader(Path path)
 {
     // Builds object from the BasicInvader class.
     // Constructor takes one parameter.
     // Stores output in the variable _incarnation1.
     _incarnation1 = new BasicInvader(path);
     // Builds object from the StrongInvader class.
     // Constructor takes one parameter.
     // Stores output in the variable _incarnation2.
     _incarnation2 = new StrongInvader(path);
 }
Пример #2
0
 public ResurrectingInvader(Path path)
 {
     _incarnation1 = new BasicInvader(path);
     _incarnation2 = new StrongInvader(path);
 }