Exemplo n.º 1
0
 private ResponseBuilder(SpeciesVitalBuilder speciesVitalsBuilder, SpeciesBuilder speciesBuilder, PetVitalBuilder petVitalBuilder, NopePetBuilder nopePetBuilder, UserSessionBuilder userSessionBuilder)
 {
     SpeciesVitalsBuilder = speciesVitalsBuilder;
     SpeciesBuilder       = speciesBuilder;
     PetVitalBuilder      = petVitalBuilder;
     NopePetBuilder       = nopePetBuilder;
     UserSessionBuilder   = userSessionBuilder;
 }
Exemplo n.º 2
0
        public static ResponseBuilder Initialise(IRepository <Animal, AnimalMetric> animalRepository,
                                                 IRepository <Metric, MetricInteraction> metricRepository, IRepository <Pet, PetMetric> petRepository,
                                                 IRepository <Interaction, MetricInteraction> interactionRepository)
        {
            if (IsInitialised)
            {
                throw new Exception("The builders have already been initialised");
            }

            var speciesCareActionBuilder = new SpeciesCareActionBuilder(interactionRepository);
            var speciesVitalsBuilder     = new SpeciesVitalBuilder(speciesCareActionBuilder, metricRepository);
            var speciesBuilder           = new SpeciesBuilder(speciesVitalsBuilder, animalRepository);
            var petVitalBuilder          = new PetVitalBuilder(metricRepository);
            var nopePetBuilder           = new NopePetBuilder(speciesBuilder, petVitalBuilder, petRepository);
            var userSessionBuilder       = new UserSessionBuilder(nopePetBuilder);

            IsInitialised = true;
            return(new ResponseBuilder(speciesVitalsBuilder, speciesBuilder, petVitalBuilder, nopePetBuilder, userSessionBuilder));
        }
Exemplo n.º 3
0
 public NopePetBuilder(SpeciesBuilder speciesBuilder, PetVitalBuilder petVitalBuilder, IRepository <Pet, PetMetric> petRepository)
 {
     _petRepository   = petRepository;
     _speciesBuilder  = speciesBuilder;
     _petVitalBuilder = petVitalBuilder;
 }
Exemplo n.º 4
0
 public IList <Species> BuildAllSpecies() => SpeciesBuilder.BuildAll();