From 16f16fa3dca4430a503168a3d341128e2ea0117e Mon Sep 17 00:00:00 2001 From: gpnb <94928039+gpnb@users.noreply.github.com> Date: Fri, 29 Mar 2024 18:57:11 +0200 Subject: [PATCH 1/2] Add files via upload --- drone.cpp | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 drone.cpp diff --git a/drone.cpp b/drone.cpp new file mode 100644 index 0000000..a56ab03 --- /dev/null +++ b/drone.cpp @@ -0,0 +1,74 @@ +#include +using namespace std; + +struct GeoLocation { + int x, y; +}; +typedef struct GeoLocation GeoLocation; + +class Drone{ + private: + FireScanner fs; + public: + Drone(FireScanner fs); +}; + +class Satellite{ + private: + GeoLocation loc; + public: + GeoLocation getLoc(); + +}; + +class FireScanner{ + public: + FireScanner(string type = "A"); + GeoLocation getLoc(Satellite s); + bool getDanger(); + string getType(); + void setter(bool d, string t); + private: + bool danger; + string type; +}; + + + +int main() { + FireScanner f("A"); + cout << f.getType() << endl; + return 0; +} + +GeoLocation Satellite::getLoc() { + return loc; +} + +GeoLocation FireScanner::getLoc(Satellite s) { + return s.getLoc(); +} + +FireScanner::FireScanner(string s) { + type = s; + danger = false; +} + +string FireScanner::getType() { + return type; +} + +bool FireScanner::getDanger() { + return danger; +} + +void FireScanner::setter(bool d, string t) { + danger = d; + type = t; +} + +Drone::Drone(FireScanner fs){ + + this->fs.setter(fs.getDanger(),fs.getType()); + cout << "Drone created" << endl; +} \ No newline at end of file From 9567917ce39d00948fe21cba0cc598f8acb98a5c Mon Sep 17 00:00:00 2001 From: gpnb <94928039+gpnb@users.noreply.github.com> Date: Fri, 29 Mar 2024 18:58:10 +0200 Subject: [PATCH 2/2] Update drone.cpp --- drone.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drone.cpp b/drone.cpp index a56ab03..ae494ec 100644 --- a/drone.cpp +++ b/drone.cpp @@ -1,3 +1,7 @@ +//sdi2100195 +//sdi2100163 +//sdi2000092 + #include using namespace std; @@ -71,4 +75,4 @@ Drone::Drone(FireScanner fs){ this->fs.setter(fs.getDanger(),fs.getType()); cout << "Drone created" << endl; -} \ No newline at end of file +}