Skip to content

Instantly share code, notes, and snippets.

@jesuscampos
Last active December 5, 2017 23:57
Show Gist options
  • Select an option

  • Save jesuscampos/50e83eed7a124bb593be3da9bdf119bc to your computer and use it in GitHub Desktop.

Select an option

Save jesuscampos/50e83eed7a124bb593be3da9bdf119bc to your computer and use it in GitHub Desktop.
Garaje garaje = new Garaje(Perfil.Sport);
garaje
.MaximaCapacidad(5)
.ConfiguraCoche((coche, perfil) =>
{
coche
.Pintar(perfil == Perfil.Sport ? "Rojo" : "Azul")
.PesoTotal(1200)
.ConGps(true)
.Puertas(perfil == Perfil.Sport ? 3 : 5)
.ConfiguraMotor(motor =>
{
motor
.Cilindrada(motor.NumeroCilindros * 500)
.Velocidades(motor.FormatoCilindro == FormatoCilindro.EnV ? 4 : 6);
})
.FuncionConsumo(motor => motor.NumeroCilindros * 2 + (coche.Peso) * 100)
.Ruedas(ruedas =>
{
ruedas
.AddRueda()
.AddRueda()
.AddRueda()
.AddRueda();
});
})
.ConfiguraMoto(moto => { //... })
.ConfiguraBici(bici => { //... });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment