private PlateauBuilder(Planet planet) { switch (planet) { case Planet.Mars: _plateau = new MarsPlateau(); break; case Planet.Venus: _plateau = new VenusPlateau(); break; } }
private RoverBuilder(Plateau plateau) { switch (plateau.Planet) { case Planet.Mars: _rover = new MarsRover(); break; case Planet.Venus: _rover = new VenueRover(); break; } _plateau = plateau; }
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; }
public static RoverBuilder Builder(Plateau plateau) => new RoverBuilder(plateau);