-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestRobotBuilder.java
More file actions
21 lines (17 loc) · 912 Bytes
/
TestRobotBuilder.java
File metadata and controls
21 lines (17 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class TestRobotBuilder {
public static void main(String[] args) {
// Get a RobotBuilder of type OldRobotBuilder
RobotBuilder oldStyleRobot = new OldRobotBuilder();
// Pass the OldRobotBuilder specification to the engineer
RobotEngineer robotEngineer = new RobotEngineer(oldStyleRobot);
// Tell the engineer to make the Robot using the specifications
robotEngineer.makeRobot();
// Get the Robot built based on the specifications
Robot firstRobot = robotEngineer.getRobot();
System.out.println("Robot Built:");
System.out.println("Robot Head Type: " + firstRobot.getRobotHead());
System.out.println("Robot Torso Type: " + firstRobot.getRobotTorso());
System.out.println("Robot Arm Type: " + firstRobot.getRobotArms());
System.out.println("Robot Leg Type: " + firstRobot.getRobotLegs());
}
}