-
Notifications
You must be signed in to change notification settings - Fork 0
/
Boat_patrol.h
78 lines (59 loc) · 1.42 KB
/
Boat_patrol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//
// Created by Admin on 6/18/2021.
//
#ifndef UNTITLED2_BOAT_PATROL_H
#define UNTITLED2_BOAT_PATROL_H
#include "Model.h"
#include "Ship.h"
class Boat_patrol: public Ship {
public:
Boat_patrol(const string &name, Point position, const int &resistance) :
Ship(name, position, object_type::patrol), _fuel(
PATROL_BOAT_FUEL_TANK_CAPACITY), _resistance(resistance) {
}
virtual void update();
void status() override;
void concreteStatus();
void dock();
void finish_route(); // this function is called only if the boat visited all the ports once
virtual ~Boat_patrol() = default;
void reFuel(double fuel);
double getFuel() const {
return _fuel;
}
void setFuel(double fuel) {
_fuel = fuel;
}
int getResistance() const {
return _resistance;
}
void setResistance(int resistance) {
_resistance = resistance;
}
bool isFinished() const {
return _finished;
}
void setFinished(bool finished = false) {
_finished = finished;
}
int getStep() const {
return _step;
}
void setStep(int step = 0) {
_step = step;
}
private:
double _fuel;
int _resistance;
bool _finished = false;
int _step = -1;
/*
* step = -1 => the ship has just been created
* step = 0 => the ship is stopped
* step = 1 => the ship is moving
* step = 2 => the ship is dead
* step = 3 => the ship is deciding which ship to move next
* step = 4 => the ship is trying to get fuel
*/
};
#endif //UNTITLED2_BOAT_PATROL_H