GetRobot() public method

public GetRobot ( ) : Robot
return Robot
        void OnEnable()
        {
            Debug.Log ("------------------");
            Debug.Log ("BUILDER DESIGN PATTERN");
            IRobotBuilder oldRobot = new OldRobotBuilder();
            RobotEngineer engineer = new RobotEngineer(oldRobot);
            engineer.MakeRobot();

            Robot firstRobot = engineer.GetRobot();
            Debug.Log ("First Robot built");
            Debug.Log (firstRobot.ToString());
        }
Example #2
0
        void OnEnable()
        {
            Debug.Log("------------------");
            Debug.Log("BUILDER DESIGN PATTERN");
            IRobotBuilder oldRobot = new OldRobotBuilder();
            RobotEngineer engineer = new RobotEngineer(oldRobot);

            engineer.MakeRobot();

            Robot firstRobot = engineer.GetRobot();

            Debug.Log("First Robot built");
            Debug.Log(firstRobot.ToString());
        }
        static void Main(string[] args)
        {
            RobotBuilder oldStyleRobot = new OldRobotBuilder();

            RobotEngineer robotEngineer = new RobotEngineer(oldStyleRobot);

            robotEngineer.MakeRobot();

            Robot firstRobot = robotEngineer.GetRobot();

            Console.WriteLine("Robot Build");

            Console.WriteLine($"Robot Head Type {firstRobot.getRobotHead()}");
            Console.WriteLine($"Robot Torso Type {firstRobot.getRobotTorso()}");
            Console.WriteLine($"Robot Arms Type {firstRobot.getRobotArms()}");
            Console.WriteLine($"Robot Legs Type {firstRobot.getRobotLegs()}");

            Console.ReadKey();
        }