Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * File: Rover.cpp
- * Author: Jonathan
- *
- * Created on 24 October 2014, 3:19 PM
- */
- #include "Rover.h"
- #include <iostream>
- #include <vector>
- #include "Device.h"
- #include "Battery.h"
- using namespace std;
- vector<Device*> devices;
- vector<Battery*> batteries;
- Rover::Rover() {
- devices.clear();
- batteries.clear();
- }
- Rover::Rover(const Rover& orig) {
- }
- Rover::~Rover() {
- }
- int Rover::deviceCount () const
- {
- return devices.size();
- }
- void Rover:: attachDevice (Device *d)
- {
- devices.push_back(d);
- }
- void Rover:: attachBattery (Battery *b)
- {
- batteries.push_back(b);
- }
- /*
- * File: Rover.h
- * Author: Jonathan
- *
- * Created on 24 October 2014, 3:19 PM
- */
- #ifndef ROVER_H
- #define ROVER_H
- class Device;
- class Radar;
- class Battery;
- class Rover {
- public:
- Rover();
- Rover(const Rover& orig);
- virtual ~Rover();
- int deviceCount () const;
- void attachDevice (Device *d);
- void attachBattery (Battery *b);
- private:
- };
- #endif /* ROVER_H */
- /*
- * File: Device.h
- * Author: Jonathan
- *
- * Created on 24 October 2014, 6:27 PM
- */
- #ifndef DEVICE_H
- #define DEVICE_H
- #include "Battery.h"
- class Device {
- protected:
- Battery* battery;
- public:
- Device();
- Device(const Device& orig);
- virtual ~Device();
- virtual void draw () = 0;
- };
- #endif /* DEVICE_H */
- /*
- * File: Device.cpp
- * Author: Jonathan
- *
- * Created on 24 October 2014, 6:27 PM
- */
- #include "Device.h"
- #include <iostream>
- #include <vector>
- #include "Battery.h"
- using namespace std;
- Device::Device() {
- }
- Device::Device(const Device& orig) {
- }
- Device::~Device() {
- }
- /*
- * File: Radar.h
- * Author: Jonathan
- *
- * Created on 24 October 2014, 3:20 PM
- */
- #ifndef RADAR_H
- #define RADAR_H
- #include "Device.h"
- #include "Battery.h"
- #include <iostream>
- using namespace std;
- class Battery;
- class Radar : public Device{
- private :
- public:
- Radar();
- Radar(Battery* b);
- Radar(const Radar& orig);
- virtual ~Radar();
- void Operate();
- };
- #endif /* RADAR_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement