コード例 #1
0
        private PlateauBuilder(Planet planet)
        {
            switch (planet)
            {
            case Planet.Mars:
                _plateau = new MarsPlateau();
                break;

            case Planet.Venus:
                _plateau = new VenusPlateau();
                break;
            }
        }
コード例 #2
0
        private RoverBuilder(Plateau plateau)
        {
            switch (plateau.Planet)
            {
            case Planet.Mars:
                _rover = new MarsRover();
                break;

            case Planet.Venus:
                _rover = new VenueRover();
                break;
            }
            _plateau = plateau;
        }
コード例 #3
0
        private RoverBuilder(Planet planet, uint plateauX, uint plateauY)
        {
            var plateau = PlateauBuilder.Builder(planet)
                          .SetX(plateauX)
                          .SetY(plateauY)
                          .Create();

            switch (plateau.Planet)
            {
            case Planet.Mars:
                _rover = new MarsRover();
                break;

            case Planet.Venus:
                _rover = new VenueRover();
                break;
            }
            _plateau = plateau;
        }
コード例 #4
0
 public static RoverBuilder Builder(Plateau plateau) => new RoverBuilder(plateau);