-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoute.h
More file actions
54 lines (43 loc) · 1.28 KB
/
Route.h
File metadata and controls
54 lines (43 loc) · 1.28 KB
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
#include <iostream>
#include <cmath>
#include "Connectable.h"
#include "Message.h"
#pragma once
// Route class to represent a transport route between 2 settlements
using namespace std;
class Route
{
private:
MailBox *m;
Connectable *sender;
Connectable *receiver;
bool repeating;
bool backwards;
bool active;
int route_time;
int time_to_arrive;
int carriage_speed = 2;
int carraige_max_load = 50;
pair<string, int> desired_payload;
pair<string, int> actual_payload;
public:
Route(MailBox *m, Connectable *sender, Connectable *receiver, string resource_name, int amount, bool repeating);
~Route() {};
int calculate_route_time();
void route_end();
void step();
void load_resources();
void unload_resources();
void stop_repeating();
bool is_active();
bool is_repeating();
bool is_backwards();
pair<string, int> get_desired_payload();
pair<string, int> get_actual_payload();
string sender_name();
pair<int, int> get_sender_coordinates();
string receiver_name();
pair<int, int> get_receiver_coordinates();
int remaining_time();
int get_route_time();
};