Skip to content
Snippets Groups Projects

Aymeric

Merged BERTHOUMIEU Aymeric requested to merge Aymeric into master
1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
+ 2
0
@@ -110,6 +110,7 @@ vector<Animal*> PetFactory::initializePopulation(int number){
for (const auto &nbPetsPerBehaviourPair : toCreate) {
createdNumber = createdNumber + static_cast<int>(nbPetsPerBehaviourPair.second);
for (int _i=0; _i<nbPetsPerBehaviourPair.second; _i++) {
cout << " " << nbPetsPerBehaviourPair.first << endl;
createdPets.push_back(this->createMember(nbPetsPerBehaviourPair.first));
}
// in case the rounding, while casting to int, results in a lower number of created pets than requested
@@ -118,6 +119,7 @@ vector<Animal*> PetFactory::initializePopulation(int number){
const auto nbPetsPerBehaviourPair = toCreate.end();
createdPets.push_back(this->createMember(nbPetsPerBehaviourPair->first));
}
statistics.saveData();
return createdPets;
}
Loading