Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fin #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions drone.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
//sdi2100195
//sdi2100163
//sdi2000092

#include <iostream>
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;
}