From ec8a3f68a4fd780768fb471fb2d22fec368ca386 Mon Sep 17 00:00:00 2001 From: mrsillydog Date: Mon, 28 Sep 2020 21:13:39 -0400 Subject: [PATCH] Removing pandemic to fix pull request --- src/examples/Pandemic/Pandemic.cpp | 64 ---------------------- src/examples/Pandemic/Pandemic.h | 88 ------------------------------ 2 files changed, 152 deletions(-) delete mode 100644 src/examples/Pandemic/Pandemic.cpp delete mode 100644 src/examples/Pandemic/Pandemic.h diff --git a/src/examples/Pandemic/Pandemic.cpp b/src/examples/Pandemic/Pandemic.cpp deleted file mode 100644 index b799c8622..000000000 --- a/src/examples/Pandemic/Pandemic.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "Pandemic.h" - -#define RADIUS 5 - -using namespace tsgl; - -Pandemic::Pandemic(Canvas& can, unsigned numPeople){ - // current day - current_day = 0; - // people counters - number_of_people = numPeople; - num_initially_infected = 0; - // states counters - num_infected = 0; - num_susceptible = numPeople; - num_immune = 0; - num_dead = 0; - - // stats - num_infections = 0; - num_infection_attempts = 0; - num_deaths = 0; - num_recoveries = 0; - - // Generate random seed - srand( time(0) ); - // // Set radius - // float radius = 250/number_of_people; - // Fill vectors - for(unsigned i = 0; i < number_of_people; ++i){ - myPersons.push_back(new Person(rand()%(can.getWindowWidth())-(can.getWindowWidth())/2, - rand()%(can.getWindowHeight())-can.getWindowHeight()/2, - RADIUS, susceptible)); // myPersons - x_locations.push_back(myPersons[i]->getX()); // x_locations - y_locations.push_back(myPersons[i]->getY()); // y_locations - infected_x_locations.push_back(0); // infected_x_locations - infected_y_locations.push_back(0); // infected_y_locations - states.push_back(susceptible); // states - num_days_infected.push_back(0); // num_days_infected - } - -} - -void Pandemic::draw(Canvas& can){ - for(unsigned i = 0; i < number_of_people; ++i){ - myPersons[i]->draw(can); - } -} - -/*! - * \brief Destructor for Pandemic. - */ -Pandemic::~Pandemic(){ - for(unsigned i = 0; i < number_of_people; ++i){ - delete myPersons[i]; - } - myPersons.clear(); - x_locations.clear(); - y_locations.clear(); - infected_x_locations.clear(); - infected_y_locations.clear(); - states.clear(); - num_days_infected.clear(); -} \ No newline at end of file diff --git a/src/examples/Pandemic/Pandemic.h b/src/examples/Pandemic/Pandemic.h deleted file mode 100644 index da12fb190..000000000 --- a/src/examples/Pandemic/Pandemic.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef PANDEMIC_H_ -#define PANDEMIC_H_ - -#include -#include -#include "Person.h" -#include "statusEnums.h" - -using namespace tsgl; - -class Pandemic { -private: - char* myName; -protected: - // persons - std::vector myPersons; - // current day - unsigned current_day; - // people counters - unsigned number_of_people; - unsigned num_initially_infected; - // states counters - unsigned num_infected; - unsigned num_susceptible; - unsigned num_immune; - unsigned num_dead; - // locations - std::vector x_locations; - std::vector y_locations; - //infected people's locations - std::vector infected_x_locations; - std::vector infected_y_locations; - // state - std::vector states; - // infected time - std::vector num_days_infected; - - // stats - unsigned num_infections; - unsigned num_infection_attempts; - unsigned num_deaths; - unsigned num_recoveries; -public: - Pandemic(Canvas& can, unsigned numPeople); - - void draw(Canvas& can); - - // Accessors - Person * getPerson(unsigned i) { return myPersons[i]; } - - unsigned getCurrentDay() { return current_day; } - - unsigned getNumPeople() { return number_of_people; } - - unsigned getNumInitiallyInfected() { return num_initially_infected; } - - unsigned getNumInfected() { return num_infected; } - - unsigned getNumSusceptible() { return num_susceptible; } - - unsigned getNumImmune() { return num_immune; } - - unsigned getNumDead() { return num_dead; } - - int getXLocation(unsigned i) { return x_locations[i]; } - - int getYLocation(unsigned i) { return y_locations[i]; } - - int getInfectedXLocation(unsigned i) { return infected_x_locations[i]; } - - int getInfectedYLocation(unsigned i) { return infected_y_locations[i]; } - - int getState(unsigned i) { return states[i]; } - - int getNumDaysInfected(unsigned i) { return num_days_infected[i]; } - - unsigned numInfections() { return num_infections; } - - unsigned getNumInfectionAttempts() { return num_infection_attempts; } - - unsigned getNumDeaths() { return num_deaths; } - - unsigned getNumRecoveries() { return num_recoveries; } - - virtual ~Pandemic(); -}; - -#endif /* PANDEMIC_H_ */ \ No newline at end of file