private ResponseBuilder(SpeciesVitalBuilder speciesVitalsBuilder, SpeciesBuilder speciesBuilder, PetVitalBuilder petVitalBuilder, NopePetBuilder nopePetBuilder, UserSessionBuilder userSessionBuilder)
 {
     SpeciesVitalsBuilder = speciesVitalsBuilder;
     SpeciesBuilder       = speciesBuilder;
     PetVitalBuilder      = petVitalBuilder;
     NopePetBuilder       = nopePetBuilder;
     UserSessionBuilder   = userSessionBuilder;
 }
        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));
        }
Beispiel #3
0
 public SpeciesBuilder(SpeciesVitalBuilder speciesVitalBuilder, IRepository <Animal, AnimalMetric> animalRepository)
 {
     _speciesVitalBuilder = speciesVitalBuilder;
     _animalRepository    = animalRepository;
 }