Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Siocnarff committed Nov 5, 2020
2 parents a3426ba + e7bd1f1 commit c2012bf
Show file tree
Hide file tree
Showing 48 changed files with 634 additions and 292 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
85 changes: 85 additions & 0 deletions cmake-build-debug/raceData.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion src/eng/buildings/ComponentSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
20 changes: 13 additions & 7 deletions src/log/Colleague.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::vector<eng::Car *>cars, 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<eng::Car*> 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");
}

}
Expand Down
8 changes: 5 additions & 3 deletions src/log/Colleague.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <races/Race.h>
#include "Car.h"
#include "races/Container.h"
#include "containers/Container.h"
//#include <iostream> //both eng- and racing- need it
namespace lg {
class Mediator;
Expand All @@ -18,9 +18,11 @@ namespace lg {

void addObserver(Mediator *obs);

void notify(eng::Car *car, Race*);
void notify(std::vector<eng::Car *>cars, Race*);

void notify(Container *container);
void notify(eng::Car* brokenCar, Race*);

/*void notify(Container *container);*/

void notify(bool isEuropeanRace);

Expand Down
Loading

0 comments on commit c2012bf

Please sign in to comment.