1Dev
Projects
Global Views
Pull Requests
Issues
Builds
Packages
drone_simulation
Code
Files
Commits
Branches
Tags
Code Comments
Code Compare
Pull Requests
Issues
List
Boards
Iterations
Builds
Packages
Statistics
Code
Child Projects
Projects
drone_simulation
Commits
a6d904e6
ctrl
k
Sign In
intergrate battery decorator to the simulation
Browse Code
main
backend-fix
Integration-v2
Hongzheng Li
committed
1 year ago
a6d904e6
1 parent
9e68be41
service/src/simulationmodel/factory/DroneFactory.cc
■ ■
■ ■
■ ■
1
1
#include "DroneFactory.h"
2
-
2
+
#include "DroneBatteryDecorator.h"
3
3
IEntity* DroneFactory::createEntity(const JsonObject& entity) {
4
4
std::string type = entity["type"];
5
5
if (type.compare("drone") == 0) {
6
6
std::cout << "Drone Created" << std::endl;
7
-
return new Drone(entity);
7
+
return new
DroneBatteryDecorator
(
new
Drone(entity
)
,
100
,
100
,
20
,
5
.
0
);
8
8
}
9
9
return nullptr;
10
10
}
skipped 1 lines
All occurrences
service/src/simulationmodel/factory/DroneFactory.cc
Please wait...
Page is in error, reload to recover