Population::Population(int nbPrey, int nbObs, int nbPredator, double radiusP, double re, double w, double h, double g1, double g2, double g3, double g4) { ag = new Agent[MAX_POP]; nbPop = nbPrey + nbObs; pr = new Predator[MAX_POP]; nbPred = nbPredator; for (int i = 0; i < nbPrey; ++i) { ag[i]= Agent(w,h, false); } for (int i = nbPrey; i < nbPop; ++i) { ag[i] = Agent(w,h,true); } for(int i=0; i<nbPred; i++) { pr[i]= Predator(w,h,radiusP, re); } W = w; H = h; G1 = g1; G2 = g2; G3 = g3; G4 = g4; }
void Factory::producePredator() { predators.push_back(Predator("predator", gameObject::position)); }