diff --git a/CMakeLists.txt b/CMakeLists.txt index aa5da25..de7d764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,14 +72,14 @@ add_executable(VierEenTwee src/log/enums/TrackComplexity.h src/log/enums/WeatherConditions.h src/log/races/Aggregate.h - src/log/races/Box.cpp - src/log/races/Box.h - src/log/races/CateringEquipment.cpp - src/log/races/CateringEquipment.h - src/log/races/Container.cpp - src/log/races/Container.h - src/log/races/GarageEquipment.cpp - src/log/races/GarageEquipment.h + src/log/containers/Box.cpp + src/log/containers/Box.h + src/log/containers/CateringEquipment.cpp + src/log/containers/CateringEquipment.h + src/log/containers/Container.cpp + src/log/containers/Container.h + src/log/containers/GarageEquipment.cpp + src/log/containers/GarageEquipment.h src/log/races/Iterator.h src/log/races/Race.cpp src/log/races/Race.h diff --git a/cmake-build-debug/raceData.txt b/cmake-build-debug/raceData.txt new file mode 100644 index 0000000..00fea88 --- /dev/null +++ b/cmake-build-debug/raceData.txt @@ -0,0 +1,85 @@ +21 +Australia +2 +0 +58 +Bahrain +2 +0 +57 +China +3 +0 +56 +Azerbaijan +1 +0 +51 +Spain +3 +1 +66 +Monaco +3 +1 +78 +Canada +1 +0 +70 +France +2 +1 +53 +Austria +1 +1 +71 +Great Britain +2 +1 +52 +Germany +2 +1 +67 +Hungary +2 +1 +70 +Belgium +3 +1 +44 +Italy +1 +1 +53 +Singapore +3 +0 +61 +Russia +1 +0 +53 +Japan +3 +0 +53 +Mexico +2 +0 +71 +United States +3 +0 +56 +Brazil +1 +0 +71 +Abu Dhabi +3 +0 +55 \ No newline at end of file diff --git a/src/eng/buildings/ComponentSimulator.cpp b/src/eng/buildings/ComponentSimulator.cpp index e1067d2..4485e48 100644 --- a/src/eng/buildings/ComponentSimulator.cpp +++ b/src/eng/buildings/ComponentSimulator.cpp @@ -18,7 +18,9 @@ void ComponentSimulator::testComponent(Component* component) { void ComponentSimulator::testComponents(Car* car) { for (Component* component : car->components) { - testComponent(component); + if (component) { + testComponent(component); + } } pr::Doc::detail("Components of car "); pr::Doc::detail(std::to_string(car->getId())); diff --git a/src/log/Colleague.cpp b/src/log/Colleague.cpp index 26861ca..aa85f59 100644 --- a/src/log/Colleague.cpp +++ b/src/log/Colleague.cpp @@ -12,21 +12,27 @@ void Colleague::addObserver(Mediator *obs) { logisticsDept = obs; } -void Colleague::notify(eng::Car *car, Race* r) { - logisticsDept->sendCarToFactory(car, r); +void Colleague::notify(std::vectorcars, Race* r) { + logisticsDept->sendCarToFactory(cars, r, false); } -void Colleague::notify(Container *container) { - logisticsDept->containerHasBeenPacked(container); +void Colleague::notify(eng::Car *broken, Race *r) { + std::vector brokenCar; + brokenCar.push_back(broken); + logisticsDept->sendCarToFactory(brokenCar, r, true); } + +/*void Colleague::notify(Container *container) { + logisticsDept->containerHasBeenPacked(container); +}*/ + void Colleague::notify(bool isEuropeanRace) { //logisticsDept->requestContainerStateChange(isEuropeanRace); - //TODO : change to pr::DOC if (isEuropeanRace) { - std::cout << "Transportation in Europe\n"; + pr::Doc::summary("Transportation in Europe\n"); } else { - std::cout << "Transportation outside of Europe\n"; + pr::Doc::summary("Transportation outside of Europe\n"); } } diff --git a/src/log/Colleague.h b/src/log/Colleague.h index dbf245f..3230ad3 100644 --- a/src/log/Colleague.h +++ b/src/log/Colleague.h @@ -7,7 +7,7 @@ #include #include "Car.h" -#include "races/Container.h" +#include "containers/Container.h" //#include //both eng- and racing- need it namespace lg { class Mediator; @@ -18,9 +18,11 @@ namespace lg { void addObserver(Mediator *obs); - void notify(eng::Car *car, Race*); + void notify(std::vectorcars, Race*); - void notify(Container *container); + void notify(eng::Car* brokenCar, Race*); + + /*void notify(Container *container);*/ void notify(bool isEuropeanRace); diff --git a/src/log/Logistics.cpp b/src/log/Logistics.cpp index 8fd6ad9..2000ed2 100644 --- a/src/log/Logistics.cpp +++ b/src/log/Logistics.cpp @@ -10,14 +10,20 @@ #include #include -#include -#include -#include +#include +#include +#include +#include #include #include "enums/randomisation.h" using namespace lg; +// TODO : @jo Implement and check accuracy of pop and push for cars +// IDEA : approach budget people in the middle to ask for raise? +// IDEA : use up the budget +// TODO : @both fix memleaks + /** * @author Jo * @status Done and dusted! @@ -28,16 +34,23 @@ Logistics::Logistics(int numDriverCarPairs) { carsInSeasonIDs.reserve(numDriverCarPairs); seasonPointTally.reserve(numDriverCarPairs); transportManager = nullptr; - raceIterator = nullptr; racingCalendar = nullptr; europeanContainer = nullptr; currentTeamStrategy = nullptr; + tyreSpecs = nullptr; budget = -1; } -Logistics::~Logistics() { -} - +// TODO : @jo finish destructor +Logistics::~Logistics(){ + if (transportManager) delete transportManager; + if (racingCalendar) { + //delete accordingly + } + if (europeanContainer) delete europeanContainer; + if (currentTeamStrategy) delete currentTeamStrategy; + if (tyreSpecs) delete tyreSpecs; +}; /** * @status completed @@ -55,17 +68,17 @@ void Logistics::registerNotifier(Colleague *colleague) { } - /** * @author Jo * @status really finished */ void Logistics::doYearPlanning() { //1. getBudget from "Sponsors" - budget = abs(rand() % 100 + 1); + sponsoredBudget(); //2. Hire emplpoyees: each department for (auto const&[key, val] : departments) { + //TODO : check by departemente - kan julle dit hanteer dat ons re-hire gegewe 'n tweede seisoen? val->hireEmployees(budget); } @@ -78,7 +91,7 @@ void Logistics::doYearPlanning() { //5. Hire drivers ppl::HireDriver driverCurator; for (int i = 0; i < numPairs; ++i) { - drivers.push_back(static_cast(driverCurator.hire("Driver"))); + drivers.push_back(dynamic_cast(driverCurator.hire("Driver"))); } //6. Set drivers' home tracks @@ -102,18 +115,17 @@ void Logistics::doYearPlanning() { */ void Logistics::preSeasonPreparation() { // 1. Get strategy - currentTeamStrategy = callRacingDept()->PlanSeasonStrategy(budget /*+ something else? */ ); - //TODO : change to doc - cout << "The Strategists of the " << callRacingDept()->getTeamName() << " team have decided on a strategy: " - << currentTeamStrategy->getStratName() << std::endl; + currentTeamStrategy = callRacingDept()->PlanSeasonStrategy(budget); + pr::Doc::detail("The Strategists of the " + callRacingDept()->getTeamName() + " team have decided on a strategy: " + + currentTeamStrategy->getStratName()); // 1.1 Notified about tyres (in the meanwhile) // 1.2 Receive Order - std::cout << "Tyre Order has arrived" << endl; - //tyreSpecs->printStats(); //not always + pr::Doc::summary("Tyre Order has arrived"); + //tyreSpecs->printStats(); //hierdie moet seker wel geimplimenteer word om op verskillende vlakke te print? //2. Pack containers - cout << "Ordering the necessary tooleries and garage equipment thingamabobs\n"; + pr::Doc::detail("Ordering the necessary tooleries and garage equipment thingamabobs\n"); packContainers(); //3. Train drivers @@ -142,7 +154,7 @@ void Logistics::packContainers() { nonEuropeanContainers.push_back(packSingleContainer()); } } - cout << "Packed all containers" << endl; + pr::Doc::summary("Packed all containers\n"); } /** @@ -150,22 +162,23 @@ void Logistics::packContainers() { * @status She be done * @return Packed Container */ -Container *Logistics::packSingleContainer() { +Container *Logistics::packSingleContainer() const { Box *box = new Box(); - auto *garageEquip = new GarageEquipment(); - auto *cateringEquip = new CateringEquipment(); + auto *garageEquip = new GarageEquipment(budget); + auto *cateringEquip = new CateringEquipment(budget); box->addElement(garageEquip); box->addElement(cateringEquip); - cout << "Packed a container" << endl; + pr::Doc::summary("Packed a container\n"); + pr::Doc::detail("\n"); + box->print(); + pr::Doc::detail("\n"); return box; } - -// TODO : Check again void Logistics::simulateEvent(Race *r) { //1. Transport car (from factory to race location) //1.1 Fill up clipboard @@ -177,14 +190,11 @@ void Logistics::simulateEvent(Race *r) { } //2. Transport Drivers + //IDEA : add fly functionality for drivers pr::Doc::detail("The two drivers are transported in a luxury mode of transport to "); pr::Doc::detail(r->getLocation()); - //Transport drivers - // TODO : add fly functionality for drivers - //3. get correct container, transport and fly and fly - // TODO : test transporter transportManager->transport(r->prevRace(), r); if (r->isRaceEuropean()) { callRacingDept()->preRaceArrival(carClipboard, drivers, r, getEuropeanContainer(), tyreSpecs); @@ -200,26 +210,32 @@ void Logistics::simulateEvent(Race *r) { //5. finish the packup Container *tCont = callRacingDept()->postRacePackUp(); + //6. Transport drivers on and container back + if (r->nextRace() == nullptr) { + pr::Doc::detail("The drivers are transported in a luxury mode of transport back to HQ"); + transportManager->transport(r, nullptr); + if (r->isRaceEuropean()) { + delete tCont; //we need to get rid of it. + } + } if (!r->isRaceEuropean()) { + //TODO : @jo check possible double-delete here delete tCont; //nonEuropeanContainer won't be used again } //else stay with the container - //6. Transport drivers on and container back } /** * @author Jo - * @status nearly there - * @ERROR hard-coded file path + * @status I wash my hands off this one */ -// TODO : Fix hard-coded file-path void Logistics::putRacesIntoCalender() { racingCalendar = new RacesList; - try { - std::ifstream infile; - infile.open("/home/jo-anne/Documents/VierEenTwee/src/log/races/raceData.txt"); - //infile.open("src/lg/races/raceData.txt"); + std::ifstream infile; + infile.open("../src/log/races/raceData.txt"); + + if (infile.is_open()) { int numRaces; infile >> numRaces; @@ -238,8 +254,9 @@ void Logistics::putRacesIntoCalender() { getline(infile, name); //to remove first random /n } infile.close(); - } catch (std::ifstream::failure e) { //exception e - std::cout << "There was a file-reading error !\n"; + } else { //exception e + std::cout << "There was a file-reading error !\n"; //die bly 'n cout aangesien dit 'n ernstige probleem is + throw "Error"; } racingCalendar->printList(); @@ -249,27 +266,50 @@ void Logistics::putRacesIntoCalender() { void Logistics::raceSeason() { //And the season starts pr::Doc::summary("And the season begins!"); + int developTracker = 0; for (RaceIterator t = racingCalendar->begin(); !(t == racingCalendar->end()); ++t) { simulateEvent(t.currentItem()); + developTracker++; + if (developTracker==7 || developTracker==14) { //third of the way through + carsInDevIDs.push_back(callEngDept()->buildCar(budget)); + } } } - -//NOT STARTED -// TODO : get leaderboard from racingDept and decide accordingly void Logistics::postSeasonDebrief() { //1. Get results - int *tumTumTum = callRacingDept()->getFinalResults(); + int *tumTumTum = callRacingDept()->getFinalResults(); //structure: {points_d1, final_pos_d1, points_d2, final_pos_d2 //2. Flashy results - //Decorator here? + // TODO: @marike Flashy results based on leaderboard (maybe racing is doing that? I'll check with them during merging) //3. let transportManager take a holiday - //Implement destructors + //TODO: @marike cout some cool stuff + delete transportManager; //4. Let driver take a holiday + int sumPositions = 0; + for (int i = 0; i < numPairs; ++i) { + ppl::Driver *d = drivers.back(); + drivers.pop_back(); + if (tumTumTum[2 * i + 1] >= 3) { + pr::Doc::detail(d->getName() + " loses all his winning money while on a holiday in Vegas\n"); + } else { + pr::Doc::detail(d->getName() + " is tactfully offered a retirement package\n"); + } + sumPositions += tumTumTum[2 * i + 1]; + } + + //5. Get some sponsors again. + sponsoredBudget(sumPositions); //5. start building a new car? + // TODO : @jo NB NB NB Adjust whole flow for cross-season functionality + pr::Doc::summary("Start working on a new car"); + for (int i = 0; i < numPairs; ++i) { + carsInSeasonIDs.push_back(callEngDept()->buildCar(budget)); + } + } @@ -294,7 +334,6 @@ Container *Logistics::getNextNonEuropean() { return back; } - /** * @author Jo * @return RacingDept Instance @@ -314,38 +353,102 @@ eng::EngTeam *Logistics::callEngDept() { } -//TODO : Decide on regime based on riskLevel //IDEA: Change to command? void Logistics::driverBootCamp() { -/*moet meer spesifiek wees hierso. gaan ons van hulle verwag of gaan ons self check dat die driver genoeg xp het? - Dalk kan ons dit volgens riskLevel doen*/ - for (ppl::Driver *d: drivers) { - //randomise weathering - callRacingDept()->trainDriver(d, rand() % 10 + 1, randomWC(), randomTL()); + //todolist : Check runtime accuracy of regime + switch (currentTeamStrategy->getRiskLevel()) { + case Safe: + for (ppl::Driver *d: drivers) { + callRacingDept()->trainDriver(d, abs(rand() % 50 + 51), Hot, Difficult); //interval [50,100] + callRacingDept()->trainDriver(d, abs(rand() % 50 + 51), Rainy, Extreme); + callRacingDept()->trainDriver(d, abs(rand() % 50 + 51), Hot, Extreme); + callRacingDept()->trainDriver(d,abs(rand() % 50 + 51), Rainy, Difficult); + } + //time higher, more weather conditions, higher track complexity, worse weather condtions + break; + case Moderate: + for (ppl::Driver *d: drivers) { + callRacingDept()->trainDriver(d, abs(rand() % 30 + 51), Normal, Difficult); //interval [30,80] + callRacingDept()->trainDriver(d, abs(rand() % 30 + 51), Rainy, Average); + callRacingDept()->trainDriver(d, abs(rand() % 30 + 51), Hot, Easy); + } + //medium time, range of weather conditions, middling track complexity + break; + case Aggressive: + for (ppl::Driver* d: drivers) { + callRacingDept()->trainDriver(d, abs(rand() % 100 + 1), randomWC(), randomTL()); //interval [1,100] + callRacingDept()->trainDriver(d, abs(rand() % 100 + 1), randomWC(), randomTL()); + callRacingDept()->trainDriver(d, abs(rand() % 100 + 1), randomWC(), randomTL()); + } + //any time,any weather, any track + break; + } +} + +void Logistics::sponsoredBudget(int sumPositions) { //default is 0 + + pr::Doc::summary("Approaching sponsors to negotiate a new budget\n"); + + if (budget == -1) { //default argument in constructor + budget = abs(rand() % 100 + 1); + } else { + //todolist : check accuracy at runtime + if (sumPositions >= 3) { + pr::Doc::detail("Rolex is the team's next sponsor! Budget increases wildly\n"); + budget = max((int) ((double) budget * 1.5), (100 - (int) ((double) budget * 0.5))); + } else if (sumPositions <= 6) { + pr::Doc::detail("Emirates is the team's next sponsor! Budget increases wildly\n"); + budget = max((int) ((double) budget * 0.2), (80 - (int) ((double) budget * 0.2))); + } else if (sumPositions <= 10) { + pr::Doc::detail("The sponsor is satisfied with the performance"); + } else { + pr::Doc::detail("This team performed horribly. Sponsor is dissatisfied. \nBudget decreases"); + budget -= (int) ((double) budget * 0.1); + } + if (budget > 100) budget = 100; + if (budget < 0) budget = 10; } + pr::Doc::summary("The team has been allocated a budget of " + to_string(budget) + "\n"); } // =========================== MEDIATOR =========================== -//TODO : Strategy for using windTunnel; -void Logistics::sendCarToFactory(eng::Car *car, Race *r) { - transportManager->transport(r, nullptr, car); - callEngDept()->carArrivesAtFactory(car); - callEngDept()->improveCar(car->getId(), true); +void Logistics::sendCarToFactory(std::vector cars, Race *r, bool isBroken) { + if (isBroken) { + for (int i = 0; i < cars.size(); ++i) { + // TODO: @marike descriptionality of the rush to get the car fixed + transportManager->transport(r, nullptr, cars[0]); + callEngDept()->carArrivesAtFactory(cars[0]); + callEngDept()->fixCar(cars[0]->getId()); + callEngDept()->improveCar(cars[0]->getId(), true); + } + } + else { + for (int i = 0; i < cars.size(); ++i) { + transportManager->transport(r, nullptr, cars[i]); + callEngDept()->carArrivesAtFactory(cars[i]); + int performance = cars[i]->getSpeed() + cars[i]->getHandling(); + // todolist : Check parameter at runtime ( & Improve strategy for using windTunnel) + if (performance > 10) { + callEngDept()->improveCar(cars[i]->getId(), false); + } else { + callEngDept()->improveCar(cars[i]->getId(), true); + } + } + } } -//NOT STARTED - should transport container here -void Logistics::containerHasBeenPacked(Container *) { +/*void Logistics::containerHasBeenPacked(Container *) { cout << "fly container" << endl; -} +}*/ /** * @status Should be done * @param tyreOrder */ -void Logistics::orderTyres(int* tyreOrder) { +void Logistics::orderTyres(int *tyreOrder) { pr::Doc::summary("Ordering tyres as informed by Racing Departement\n"); pr::Doc::detail("Tedious paperwork to complete tyre order\n"); @@ -376,3 +479,5 @@ void Logistics::orderTyres(int* tyreOrder) { + + diff --git a/src/log/Logistics.h b/src/log/Logistics.h index 971cabd..2dc0df5 100644 --- a/src/log/Logistics.h +++ b/src/log/Logistics.h @@ -34,9 +34,9 @@ namespace lg { void postSeasonDebrief(); protected: - void sendCarToFactory(eng::Car *, Race*) override; + void sendCarToFactory(std::vector, Race*, bool isBroken) override; - void containerHasBeenPacked(Container *) override; + //void containerHasBeenPacked(Container *) override; Container *getEuropeanContainer(); @@ -44,7 +44,7 @@ namespace lg { void packContainers(); - Container* packSingleContainer(); + Container* packSingleContainer() const; void simulateEvent(Race *); @@ -54,6 +54,8 @@ namespace lg { void driverBootCamp(); + void sponsoredBudget(int sumPositions = 0); + private: rce::RacingDep *callRacingDept(); eng::EngTeam *callEngDept(); @@ -62,14 +64,14 @@ namespace lg { std::vector drivers; TransportHandler *transportManager; //Won't be holding a handle to car as will always be passing directly from one place to another - RaceIterator *raceIterator; RacesList *racingCalendar; std::vector carsInSeasonIDs; + std::vector carsInDevIDs; std::vector nonEuropeanContainers; //lots of containers for non-European Container *europeanContainer; //1 container for European rce::CreateStrategy *currentTeamStrategy; - rce::Tyres* tyreSpecs; //possibly unnecessary? No + rce::Tyres* tyreSpecs{}; //possibly unnecessary? No std::vector seasonPointTally; diff --git a/src/log/Mediator.h b/src/log/Mediator.h index 9f00dc2..4e31052 100644 --- a/src/log/Mediator.h +++ b/src/log/Mediator.h @@ -7,17 +7,17 @@ #include #include "Car.h" -#include "races/Container.h" +#include "containers/Container.h" namespace lg { class Mediator { protected: -// virtual ~Mediator(); + virtual ~Mediator() = default; - virtual void sendCarToFactory(eng::Car *, Race*) = 0; + virtual void sendCarToFactory(std::vector cars, Race* currentRace, bool isBroken) = 0; - virtual void containerHasBeenPacked(Container *) = 0; + //virtual void containerHasBeenPacked(Container *) = 0; //virtual void requestContainerStateChange(bool isEuropeanRace) = 0; diff --git a/src/log/races/Box.cpp b/src/log/containers/Box.cpp similarity index 64% rename from src/log/races/Box.cpp rename to src/log/containers/Box.cpp index 71c0301..e40717c 100644 --- a/src/log/races/Box.cpp +++ b/src/log/containers/Box.cpp @@ -11,18 +11,6 @@ void Box::addElement(Container *c) { elements.push_back(c); } -void Box::pack() {} - - -void Box::unpack() { - Container::unpack(); - std::cout << "\nBox contains: " << std::endl; - for (std::list::iterator it = elements.begin(); it != elements.end(); ++it) { - (*it)->unpack(); - } - //Moet verander word en reg-geimplementeer word -} - Box::~Box() { for (std::list::iterator it = elements.begin(); it != elements.end(); ++it) { delete *it; diff --git a/src/log/races/Box.h b/src/log/containers/Box.h similarity index 87% rename from src/log/races/Box.h rename to src/log/containers/Box.h index 56c69b6..c3e1b51 100644 --- a/src/log/races/Box.h +++ b/src/log/containers/Box.h @@ -17,10 +17,6 @@ namespace lg { void addElement(Container *) override; - void unpack() override; - - void pack() override; - ~Box() override; void print() override; diff --git a/src/log/containers/CateringEquipment.cpp b/src/log/containers/CateringEquipment.cpp new file mode 100644 index 0000000..124aa5e --- /dev/null +++ b/src/log/containers/CateringEquipment.cpp @@ -0,0 +1,55 @@ +// +// Created by jo-anne on 2020/10/26. +// + +#include +#include "CateringEquipment.h" + +using namespace lg; + +/** + * @author Marike + * TODO: create constructor with int parameter + */ +CateringEquipment::CateringEquipment() { + contents.emplace_back("Water Bottles"); + contents.emplace_back("Salty cracks"); + contents.emplace_back("Towels"); + contents.emplace_back("Batteries"); + contents.emplace_back("A torch"); +} + +CateringEquipment::CateringEquipment(int budget) { + int arr = 4; + + std::string poorArr[] = {"Benches", "Water bottles", "Salty Cracks", "Gazebo"}; + std::string aveArr[] = {"Camping chairs", "Energy drinks", "Nutri bars", "Tent"}; + std::string richArr[] = {"Hospitality Sofas - Inflatable", "Champagne", "Caviar", "Gala Performance Dual Pit Walling"}; + + if (budget < 51) { + for (int x = 0; x < arr; x++) { + contents.push_back(poorArr[x]); + } + } + else if (budget < 76) { + for (int x = 0; x < arr; x++) { + contents.push_back(aveArr[x]); + } + } + else { + for (int x = 0; x < arr; x++) { + contents.push_back(richArr[x]); + } + } +} + +CateringEquipment::~CateringEquipment() = default; + +void CateringEquipment::print() { + pr::Doc::detail("Catering Equipment:\n"); + for (std::list::iterator it = contents.begin(); it != contents.end(); ++it) { + pr::Doc::detail(" "); + pr::Doc::detail(*it); + pr::Doc::detail("\n"); + } +} \ No newline at end of file diff --git a/src/log/races/CateringEquipment.h b/src/log/containers/CateringEquipment.h similarity index 81% rename from src/log/races/CateringEquipment.h rename to src/log/containers/CateringEquipment.h index ef76153..149656b 100644 --- a/src/log/races/CateringEquipment.h +++ b/src/log/containers/CateringEquipment.h @@ -9,13 +9,19 @@ namespace lg { class CateringEquipment : public Container { + private: + std::list contents; + public: + CateringEquipment(); - CateringEquipment(std::list insides); - void unpack() override; + + CateringEquipment(int); + ~CateringEquipment() override; + void print() override; }; } diff --git a/src/log/containers/Container.cpp b/src/log/containers/Container.cpp new file mode 100644 index 0000000..cd73b17 --- /dev/null +++ b/src/log/containers/Container.cpp @@ -0,0 +1,23 @@ +// +// Created by jo on 2020/10/17. +// + +#include "Container.h" +#include +using namespace lg; + +Container::Container() { +} + +Container::~Container() { + +} + +void Container::addElement(Container * newContainer) { + std::cout << "Pack box into main container" << std::endl; +} + +void Container::print() { + std::cout << "The container is currently empty" << std::endl; +} + diff --git a/src/log/races/Container.h b/src/log/containers/Container.h similarity index 88% rename from src/log/races/Container.h rename to src/log/containers/Container.h index 4276673..f5f8292 100644 --- a/src/log/races/Container.h +++ b/src/log/containers/Container.h @@ -23,10 +23,6 @@ namespace lg { virtual ~Container(); - virtual void unpack(); - - virtual void pack(); - virtual void print(); protected: diff --git a/src/log/containers/GarageEquipment.cpp b/src/log/containers/GarageEquipment.cpp new file mode 100644 index 0000000..baf7b7d --- /dev/null +++ b/src/log/containers/GarageEquipment.cpp @@ -0,0 +1,56 @@ +// +// Created by jo-anne on 2020/10/26. +// + +#include +#include "GarageEquipment.h" + +using namespace lg; + +/** + * @author Marike + * //TODO: create int parameter constructor + */ +GarageEquipment::GarageEquipment() { + contents.emplace_back("Spare Tyres"); + contents.emplace_back("Oil can"); + contents.emplace_back("Elbow Grease"); + contents.emplace_back("Nuts and bolts"); + contents.emplace_back("A spanner"); +} + +GarageEquipment::GarageEquipment(int budget) { + int arr = 5; + std::string poorArr[5] = {"Spanners", "Extra helmet", "Elbow Grease", "Nuts and bolts", "Vehicle Skates"}; + std::string aveArr[5] = {"Wheel guns", "Custom paint helmet", "Ratchet", "Dive bottle compressor", "Air Lifts"}; + std::string richArr[5] = {"Easy roll rim cleaner", "Air bottle trolleys", "Tyre warmer tent", "Box with secret compartment for Plutonium Hammer", "Wheel Gun Service Kits"}; + + if (budget < 51) { + for (int x = 0; x < arr; x++) { + contents.push_back(poorArr[x]); + } + } + else if (budget < 76) { + for (int x = 0; x < arr; x++) { + contents.push_back(aveArr[x]); + } + } + else { + for (int x = 0; x < arr; x++) { + contents.push_back(richArr[x]); + } + } + +} + +GarageEquipment::~GarageEquipment() = default; + +void GarageEquipment::print() { + pr::Doc::detail("Garage equipment:\n"); + for (std::list::iterator it = contents.begin(); it != contents.end(); ++it) { + pr::Doc::detail(" "); + pr::Doc::detail(*it); + pr::Doc::detail("\n"); + } + pr::Doc::detail("\n"); +} \ No newline at end of file diff --git a/src/log/races/GarageEquipment.h b/src/log/containers/GarageEquipment.h similarity index 81% rename from src/log/races/GarageEquipment.h rename to src/log/containers/GarageEquipment.h index 88ddc31..966c10d 100644 --- a/src/log/races/GarageEquipment.h +++ b/src/log/containers/GarageEquipment.h @@ -14,9 +14,7 @@ namespace lg { public: GarageEquipment(); - GarageEquipment(std::list insides); - - void unpack() override; + GarageEquipment(int); ~GarageEquipment() override; diff --git a/src/log/races/CateringEquipment.cpp b/src/log/races/CateringEquipment.cpp deleted file mode 100644 index c2b6bcb..0000000 --- a/src/log/races/CateringEquipment.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Created by jo-anne on 2020/10/26. -// - -#include "CateringEquipment.h" - -using namespace lg; - -CateringEquipment::CateringEquipment() {} - -void CateringEquipment::unpack() { - //Print net unpack uit -} - -CateringEquipment::CateringEquipment(std::list insides) { - if (insides.size() == 0) { - contents.push_back("Lots and lots of stuff"); - return; - } - for (std::list::iterator it = insides.begin(); it != insides.end(); ++it) { - contents.push_back(*it); - } -} - -CateringEquipment::~CateringEquipment() = default; - -void CateringEquipment::print() { - -} \ No newline at end of file diff --git a/src/log/races/Container.cpp b/src/log/races/Container.cpp deleted file mode 100644 index e589a82..0000000 --- a/src/log/races/Container.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// Created by jo on 2020/10/17. -// - -#include "Container.h" -#include -using namespace lg; - -Container::Container() { -} - -Container::~Container() { - -} - -void Container::unpack() { - //Unpack gaan net werk in die hoof container. Dit moenie geroep word later nie. - - //Print alles uit - - //Gaan soek die container wat 'n tyreBox is om dit te return . . . tyre variable to return? Ja. Okay. - - std::cout << "CONTAINER UNPACK BY printing out contents and returning the tyres in the container" << std::endl; - -} - -/** - *@author Marike - * @param usedTyres - */ -void Container::pack() { - - //Should we pack up the container? Ek dink ons hoef net 'n print funksie te hĂȘ - - std::cout << "print out contents" << std::endl; - -} - -void Container::addElement(Container * newContainer) { - std::cout << "Pack box into main container" << std::endl; -} - -void Container::print() { - std::cout << "The container is currently empty" << std::endl; -} - diff --git a/src/log/races/GarageEquipment.cpp b/src/log/races/GarageEquipment.cpp deleted file mode 100644 index dbff269..0000000 --- a/src/log/races/GarageEquipment.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Created by jo-anne on 2020/10/26. -// - -#include "GarageEquipment.h" - -using namespace lg; - -GarageEquipment::GarageEquipment() {} - -GarageEquipment::GarageEquipment(std::list insides) { - if (insides.size() == 0) { - contents.push_back("Lots and lots of stuff"); - return; - } - for (std::list::iterator it = insides.begin(); it != insides.end(); ++it) { - contents.push_back(*it); - } -} - -void GarageEquipment::unpack() { - for (std::list::iterator it = contents.begin(); it != contents.end(); ++it) { - std::cout << "-" << (*it) << std::endl; - } -} - -GarageEquipment::~GarageEquipment() = default; - -void GarageEquipment::print() {} \ No newline at end of file diff --git a/src/log/races/Race.cpp b/src/log/races/Race.cpp index 638c02d..ce0d0f9 100644 --- a/src/log/races/Race.cpp +++ b/src/log/races/Race.cpp @@ -102,6 +102,8 @@ int Race::getTrackID() { return id; } +Race::~Race() = default; + /*std::ostream &lg::operator<<(std::ostream &os, const Race &rc) { os << rc.location << '/nEurope: ' << rc.isInEurope << '/nNumLaps: ' << rc.numLaps << std::endl; return os; diff --git a/src/log/races/Race.h b/src/log/races/Race.h index c61f678..787054b 100644 --- a/src/log/races/Race.h +++ b/src/log/races/Race.h @@ -26,6 +26,8 @@ namespace lg { Race(std::string, int complexity, bool inEU, int laps, Race *next = nullptr, Race *prev = nullptr); + ~Race(); + void setNextRace(Race *); void setPrevRace(Race *); diff --git a/src/log/races/RaceIterator.cpp b/src/log/races/RaceIterator.cpp index 9d07846..ef34d14 100644 --- a/src/log/races/RaceIterator.cpp +++ b/src/log/races/RaceIterator.cpp @@ -21,7 +21,6 @@ void RaceIterator::first() { current = head; } -//RaceIterator RaceIterator::operator++() { void RaceIterator::operator++() { if (this != nullptr) { this->current = this->current->nextRace(); diff --git a/src/log/races/RacesList.cpp b/src/log/races/RacesList.cpp index 3b1ad55..3cca13a 100644 --- a/src/log/races/RacesList.cpp +++ b/src/log/races/RacesList.cpp @@ -6,17 +6,38 @@ #include "RacesList.h" #include "Doc.h" -using namespace lg; +namespace lg { + // TODO : find suitable spot for this function + std::string convertComplexityToString(TrackComplexity t) { + switch (t) { + case Easy: + return "Easy"; + case Average: + return "Average"; + case Difficult: + return "Difficult"; + case Extreme: + return "Extreme"; + } + } +} -/*RaceIterator RacesList::createIterator() { - return RaceIterator(*this, headRace); -}*/ +using namespace lg; RacesList::RacesList() { headRace = nullptr; numRaces = 0; } +RacesList::~RacesList() { + for (RaceIterator t = begin(); !(t == end()); ) { + Race* temp = t.currentItem(); + ++t; + delete temp; + } + +} + //IS DONE? void RacesList::addRace(Race *race) { if (isEmpty()) { @@ -64,14 +85,13 @@ void RacesList::printList() { } else { while (temp != nullptr) { pr::Doc::detail(temp->getLocation()); - pr::Doc::detail("\nNumLaps: "); + pr::Doc::detail("\nNumber of Laps: "); pr::Doc::detail(std::to_string(temp->getNumLaps())); - pr::Doc::detail("\nWeather:"); - // TODO : add back in race day weather -// pr::Doc::detail(temp->getRaceDayWeather()); + pr::Doc::detail("\nTrack Complexity: "); + pr::Doc::detail(convertComplexityToString(temp->getTrackComplexity())); pr::Doc::detail("\n"); - std::cout << temp->getLocation() << "\nNumLaps: " << temp->getNumLaps() << "\nWeather:" - << temp->getRaceDayWeather() << std::endl; + /*std::cout << temp->getLocation() << "\nNumLaps: " << temp->getNumLaps() << "\nWeather:" + << temp->getRaceDayWeather() << std::endl;*/ temp = temp->nextRace(); } } diff --git a/src/log/races/RacesList.h b/src/log/races/RacesList.h index 154679b..9226873 100644 --- a/src/log/races/RacesList.h +++ b/src/log/races/RacesList.h @@ -10,18 +10,16 @@ #include "RaceIterator.h" namespace lg { -//class RacesList : public Aggregate { class RacesList { friend class RaceIterator; public: -// RaceIterator createIterator() override; RacesList(); - //RaceIterator createIterator(); + ~RacesList(); + void addRace(Race *); - //Race* removeRace(); Race *getHeadRace() const; bool isEmpty(); diff --git a/src/log/transportation/Fly.cpp b/src/log/transportation/Fly.cpp index 586c294..5bb8a50 100644 --- a/src/log/transportation/Fly.cpp +++ b/src/log/transportation/Fly.cpp @@ -26,3 +26,7 @@ void Fly::transport(Race *fromLocation, Race *destination, eng::Car *car) { } } +Fly::~Fly() { + +} + diff --git a/src/log/transportation/Fly.h b/src/log/transportation/Fly.h index 0dce101..3b2976e 100644 --- a/src/log/transportation/Fly.h +++ b/src/log/transportation/Fly.h @@ -12,6 +12,7 @@ namespace lg { class Fly : public TransportHandler { public: void transport(Race *fromLocation, Race *destination, eng::Car *car = nullptr) override; + ~Fly(); }; } diff --git a/src/log/transportation/Road.cpp b/src/log/transportation/Road.cpp index 54aeeaf..7d05f99 100644 --- a/src/log/transportation/Road.cpp +++ b/src/log/transportation/Road.cpp @@ -29,3 +29,7 @@ void Road::transport(Race *fromLocation, Race *destination, eng::Car *car) { } } + +Road::~Road() { + +} diff --git a/src/log/transportation/Road.h b/src/log/transportation/Road.h index fc1209a..876c91e 100644 --- a/src/log/transportation/Road.h +++ b/src/log/transportation/Road.h @@ -12,6 +12,7 @@ namespace lg { class Road : public TransportHandler { public: void transport(Race *fromLocation, Race *destination, eng::Car *car = nullptr) override; + ~Road(); }; } diff --git a/src/log/transportation/Ship.cpp b/src/log/transportation/Ship.cpp index 4b9c57c..457080a 100644 --- a/src/log/transportation/Ship.cpp +++ b/src/log/transportation/Ship.cpp @@ -28,3 +28,7 @@ void Ship::transport(Race *fromLocation, Race *destination, eng::Car *car) { } } +Ship::~Ship() { + +} + diff --git a/src/log/transportation/Ship.h b/src/log/transportation/Ship.h index a5fac73..fab0f15 100644 --- a/src/log/transportation/Ship.h +++ b/src/log/transportation/Ship.h @@ -12,6 +12,7 @@ namespace lg{ class Ship : public TransportHandler { public: void transport(Race *fromLocation, Race *destination, eng::Car *car = nullptr) override; + ~Ship(); }; } diff --git a/src/log/transportation/TransportHandler.cpp b/src/log/transportation/TransportHandler.cpp index b7a7ca2..4c30dab 100644 --- a/src/log/transportation/TransportHandler.cpp +++ b/src/log/transportation/TransportHandler.cpp @@ -19,6 +19,13 @@ void TransportHandler::addAMethod(TransportHandler *transport) { } } +TransportHandler::~TransportHandler() { + if (nextTransportationMethod) { + delete nextTransportationMethod; + } + +} + void TransportHandler::transport(Race *fromLocation, Race *destination, eng::Car *car) { if (nextTransportationMethod) { nextTransportationMethod->transport(fromLocation, destination, car); diff --git a/src/log/transportation/TransportHandler.h b/src/log/transportation/TransportHandler.h index ed9a76b..9ff2229 100644 --- a/src/log/transportation/TransportHandler.h +++ b/src/log/transportation/TransportHandler.h @@ -17,6 +17,8 @@ namespace lg { private: TransportHandler *nextTransportationMethod = nullptr; public: + ~TransportHandler(); + void hireEmployees(int budget) override; void addAMethod(TransportHandler *transport); diff --git a/src/main.cpp b/src/main.cpp index ae0cef5..13d38ca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include "ppl/factories/KidnapStudent.h" #include "eng/EngTeam.h" #include "rce/RacingDep.h" @@ -18,19 +19,52 @@ int pr::Doc::transparency = 1; void logDeptTesting(); void engTeamTesting(); -void seasonRun(); +void seasonRun(lg::Logistics*); +void testTyres(); +void proto_FinalMain(); int main() { //logDeptTesting(); - engTeamTesting(); + //engTeamTesting(); //seasonRun(); + proto_FinalMain(); + //testTyres(); + + + } -void logDeptTesting() { +void proto_FinalMain() { auto* racingDept = new rce::RacingDep(); auto* engDept = new eng::EngTeam; + auto* logDept = new lg::Logistics; + + srand(time(0)); + logDept->registerNotifier(racingDept); + logDept->registerNotifier(engDept); + + seasonRun(logDept); + + delete racingDept; + delete engDept; + delete logDept; + +} + + +void seasonRun(lg::Logistics* a) { + a->doYearPlanning(); + a->preSeasonPreparation(); + a->raceSeason(); + a->postSeasonDebrief(); +} + +void logDeptTesting() { + //Testing containers + /* auto* racingDept = new rce::RacingDep(); + auto* engDept = new eng::EngTeam; auto* a = new lg::Logistics; lg::TransportHandler* curator = new lg::Road; @@ -49,23 +83,17 @@ void logDeptTesting() { delete racingDept; delete engDept; - delete a; + delete a;*/ + //Testing racingCalender destructor + lg::RacesList* r = new lg::RacesList; + r->addRace(new lg::Race("Australia", 0, 0,12)); + r->addRace(new lg::Race("Benoni", 1, 1,21)); + r->addRace(new lg::Race("Cambridge", 2, 0,112)); + r->addRace(new lg::Race("Dallas", 0, 1,212)); + r->printList(); + delete r; } -void seasonRun() { - auto* racingDept = new rce::RacingDep(); - auto* engDept = new eng::EngTeam; - auto* a = new lg::Logistics; - a->registerNotifier(racingDept); - a->registerNotifier(engDept); - a->doYearPlanning(); - a->preSeasonPreparation(); - a->raceSeason(); - a->postSeasonDebrief(); - delete racingDept; - delete engDept; - delete a; -} void engTeamTesting() { auto *e = new eng::EngTeam(); @@ -101,4 +129,48 @@ void engTeamTesting() { delete fixedCar; delete e; -} \ No newline at end of file +} + +void testTyres() { + int arr1[3] = {2,1,2}; + int arr2[3] = {0,1,4}; + int arr3[3] = {0,0,5}; + + + auto* tyres1 = new rce::Tyres(arr1); + auto* tyres2 = new rce::Tyres(arr2); + auto* tyres3 = new rce::Tyres(arr3); + + tyres1->printStats(); +// tyres2->printStats(); +// tyres3->printStats(); + + SetOfTyres* tyreSet1 = tyres1->getTyres(0); + SetOfTyres* tyreSet2 = tyres1->getTyres(0); + SetOfTyres* tyreSet3 = tyres1->getTyres(0); + + + if (tyreSet1 != nullptr) { + tyreSet1->printStats(); + + tyreSet1->reduceThread(49); + tyreSet1->printStats(); + + for (int x = 0; x < 20; x++) { + tyreSet1->reduceThread(2); + } + + tyreSet1->printStats(); + + } + + if(tyreSet3 == nullptr) { + std::cout << "No more tyres of that type" << std::endl; + } + + tyres1->printStats(); + delete tyres1; + delete tyres2; + delete tyres3; + + } diff --git a/src/rce/RaceWeekend.h b/src/rce/RaceWeekend.h index c4460aa..72f0b79 100644 --- a/src/rce/RaceWeekend.h +++ b/src/rce/RaceWeekend.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include "PitCrew.h" diff --git a/src/rce/RacingDep.cpp b/src/rce/RacingDep.cpp index 3231863..98ec6ef 100644 --- a/src/rce/RacingDep.cpp +++ b/src/rce/RacingDep.cpp @@ -10,7 +10,7 @@ using namespace rce; void RacingDep::hireEmployees(int b) { - // TODO - implement RacingDep::HireWorker + // - implement RacingDep::HireWorker //throw "Not yet implemented"; } @@ -138,32 +138,35 @@ ppl::Driver *RacingDep::trainDriver(ppl::Driver *driver, int time, lg::WeatherCo { }*/ -void RacingDep::preRaceArrival(std::vector, std::vector, lg::Race *, lg::Container *, Tyres *) { -// TODO - implement RacingDep::preRaceArrival +void RacingDep::preRaceArrival(std::vector cars, std::vector, lg::Race *r, lg::Container *cont, Tyres *) { +// - implement RacingDep::preRaceArrival + this->CarContainer = cont; + this->race = r; + this->cars = cars; //throw "Not yet implemented"; } /*int RacingDep::RacingWeekend() { - // TODO - implement RacingDep::Race + // - implement RacingDep::Race throw "Not yet implemented"; }*/ /*void RacingDep::postRacePackUp() { - // TODO - implement RacingDep::postRacePackUp + // - implement RacingDep::postRacePackUp throw "Not yet implemented"; }*/ /*void RacingDep::registerForSeason(lg::Observer* logisticsDept) { - // TODO - implement RacingDep::registerForSeason + // - implement RacingDep::registerForSeason throw "Not yet implemented"; }*/ Leaderboard* RacingDep::getResults() { - // TODO - implement RacingDep::getResults + // - implement RacingDep::getResults throw "Not yet implemented"; } @@ -174,38 +177,38 @@ lg::Race* RacingDep::getRace() void RacingDep::setResult(int result) { - // TODO - implement RacingDep::setResult + // - implement RacingDep::setResult throw "Not yet implemented"; } int RacingDep::getResult() { - // TODO - implement RacingDep::getResult + // - implement RacingDep::getResult throw "Not yet implemented"; } std::string RacingDep::getTeamName() { - // TODO - implement RacingDep::getTeamName + // - implement RacingDep::getTeamName //throw "Not yet implemented"; return "standard team name"; } void RacingDep::setTeamName(std::string TeamName) { - // TODO - implement RacingDep::setTeamName + // - implement RacingDep::setTeamName throw "Not yet implemented"; } std::list RacingDep::getStategist() { - // TODO - implement RacingDep::getStategist + // - implement RacingDep::getStategist throw "Not yet implemented"; } void RacingDep::setStategist(std::list Stategist) { - // TODO - implement RacingDep::setStategist + // - implement RacingDep::setStategist throw "Not yet implemented"; } @@ -222,16 +225,19 @@ void RacingDep::setPitcrew(std::list pitcrew) void RacingDep::SetCarAfterRace() { - // TODO - implement RacingDep::SetCarAfterRace + // - implement RacingDep::SetCarAfterRace throw "Not yet implemented"; } int *RacingDep::RacingWeekend() { - return nullptr; + int *results = new int[2]; + results[0] = 5; results[1] = 6; + return results; } lg::Container *RacingDep::postRacePackUp() { - return nullptr; + notify(cars, race); + return this->CarContainer; } RacingDep::~RacingDep() { @@ -239,13 +245,15 @@ RacingDep::~RacingDep() { } RacingDep::RacingDep() { - strategy = nullptr; std::cout << "Constructor" << std::endl; } int *RacingDep::getFinalResults() { //return array {score1,postition1,score2, postion2} - throw "Not yet implemented"; + //throw "Not yet implemented"; + int* results = new int[4]; + results[0] = 512; results[1] = 1; results[2] = 213; results[3] = 5; + return results; } diff --git a/src/rce/RacingDep.h b/src/rce/RacingDep.h index 6ae8c73..74b7b88 100644 --- a/src/rce/RacingDep.h +++ b/src/rce/RacingDep.h @@ -21,7 +21,7 @@ namespace rce { std::string TeamName; //std::list Stategist; std::list pitcrew; - eng::Car *car; + std::vector cars; // / ppl::Driver array of size 2? // / car array of size 2? @@ -57,7 +57,7 @@ namespace rce { int* getFinalResults(); - // TODO : Besluit dalk watter funksies eintlik protected en private moet wees + // Besluit dalk watter funksies eintlik protected en private moet wees Leaderboard *getResults(); diff --git a/src/rce/carState/CarState.cpp b/src/rce/carState/CarState.cpp index f99a008..649e5db 100644 --- a/src/rce/carState/CarState.cpp +++ b/src/rce/carState/CarState.cpp @@ -16,7 +16,7 @@ void CarState::setDamage(int damage) { } void CarState::Deal_damage(int d) { - // TODO - implement carState::Deal damage + // implement carState::Deal damage throw "Not yet implemented"; } diff --git a/src/rce/carState/CarStateDamaged.cpp b/src/rce/carState/CarStateDamaged.cpp index 397cb4e..98213b1 100644 --- a/src/rce/carState/CarStateDamaged.cpp +++ b/src/rce/carState/CarStateDamaged.cpp @@ -3,7 +3,7 @@ using namespace rce; void CarStateDamaged::handleChange(int i, int d) { - // TODO - implement CarStateDamaged::handleChange + // - implement CarStateDamaged::handleChange throw "Not yet implemented"; } diff --git a/src/rce/leaderboard/DriversLeaderboard.cpp b/src/rce/leaderboard/DriversLeaderboard.cpp index 982c832..5de77f8 100644 --- a/src/rce/leaderboard/DriversLeaderboard.cpp +++ b/src/rce/leaderboard/DriversLeaderboard.cpp @@ -4,7 +4,7 @@ using namespace rce; /*void DriversLeaderboard::UpdateDriverLeaderBoard(String driverName, int Score) { - // TODO - implement DriversLeaderboard::UpdateDriverLeaderBoard + // - implement DriversLeaderboard::UpdateDriverLeaderBoard throw "Not yet implemented"; }*/ diff --git a/src/rce/pitstop/ChangeTyre.cpp b/src/rce/pitstop/ChangeTyre.cpp index 09457b5..441ce06 100644 --- a/src/rce/pitstop/ChangeTyre.cpp +++ b/src/rce/pitstop/ChangeTyre.cpp @@ -3,6 +3,6 @@ using namespace rce; void ChangeTyre::changetyres() { - // TODO - implement ChangeTyre::changetyres + // - implement ChangeTyre::changetyres throw "Not yet implemented"; } diff --git a/src/rce/pitstop/DriverPitStop.cpp b/src/rce/pitstop/DriverPitStop.cpp index cf6a514..a0dae56 100644 --- a/src/rce/pitstop/DriverPitStop.cpp +++ b/src/rce/pitstop/DriverPitStop.cpp @@ -3,7 +3,7 @@ using namespace rce; /*void DriverPitStop::tyres(int t, int compounds) { - // TODO - implement DriverPitStop::tyres + // implement DriverPitStop::tyres throw "Not yet implemented"; }*/ @@ -12,11 +12,11 @@ void DriverPitStop::setCar(eng::Car* c) { } void DriverPitStop::tyres(Tyres *t) { - // TODO - implement DriverPitStop::tyres + // - implement DriverPitStop::tyres throw "Not yet implemented"; } void DriverPitStop::race() { - // TODO - implement DriverPitStop::race + // - implement DriverPitStop::race throw "Not yet implemented"; } diff --git a/src/rce/pitstop/PitCrew.cpp b/src/rce/pitstop/PitCrew.cpp index 5261fa4..8b891fb 100644 --- a/src/rce/pitstop/PitCrew.cpp +++ b/src/rce/pitstop/PitCrew.cpp @@ -3,11 +3,11 @@ using namespace rce; PitCrew::PitCrew() { - // TODO - implement PitCrew::PitCrew + // - implement PitCrew::PitCrew throw "Not yet implemented"; } void PitCrew::setCar(RaceDaysIterator* c) { - // TODO - implement PitCrew::setCar + // - implement PitCrew::setCar throw "Not yet implemented"; } diff --git a/src/rce/pitstop/Pitstop.cpp b/src/rce/pitstop/Pitstop.cpp index 0c39a4f..1dc7d00 100644 --- a/src/rce/pitstop/Pitstop.cpp +++ b/src/rce/pitstop/Pitstop.cpp @@ -3,33 +3,33 @@ using namespace rce; void Pitstop::addCrew(std::list p) { -// TODO - implement Pitstop::addCrew +// - implement Pitstop::addCrew throw "Not yet implemented"; } void Pitstop::detachCrew(std::list p) { -// TODO - implement Pitstop::detachCrew +// - implement Pitstop::detachCrew throw "Not yet implemented"; } void Pitstop::tyres(Tyres* t) { - // TODO - implement Pitstop::tyres + // - implement Pitstop::tyres throw "Not yet implemented"; } void Pitstop::notify() { - // TODO - implement Pitstop::notify + // - implement Pitstop::notify throw "Not yet implemented"; } void Pitstop::setCar(eng::Car* c) { - // TODO - implement Pitstop::setCar + // - implement Pitstop::setCar throw "Not yet implemented"; } /* void Pitstop::race() { - // TODO - implement Pitstop::race + // - implement Pitstop::race throw "Not yet implemented"; } */ diff --git a/src/rce/strategy/AggressiveStrategy.cpp b/src/rce/strategy/AggressiveStrategy.cpp index a77fa3e..f21ea53 100644 --- a/src/rce/strategy/AggressiveStrategy.cpp +++ b/src/rce/strategy/AggressiveStrategy.cpp @@ -10,6 +10,6 @@ AggressiveStrategy::AggressiveStrategy(int p,int* t,int risk) std::cout<<"The startegists have decided to implement an aggressive strategy"<