BuilderPattern.Robot.ToString C# (CSharp) Méthode

ToString() public méthode

public ToString ( ) : string
Résultat string
        public string ToString()
        {
            return "Head: " + this.head + ", torso: " + this.torso + ", Arms: " + arms + ", legs: " + legs;
        }

Usage Example

Exemple #1
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());
        }