-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCargo.h
153 lines (146 loc) · 2.4 KB
/
Cargo.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/**
* @file Cargo.h
* @brief Cargo Class
* @version 0.1
* @copyright Copyright secured by YMY Team(c) 2022
*/
#pragma once
#include"Def.h"
#include "Time.h"
#include <string>
#include <iostream>
class Cargo
{
private:
/**
* @brief Time(day:hour) at which the cargo is ready to be loaded
*/
Time Preparation_Time;
Time WT;
Time DT;
float Load_Unload_Time;
CARGO_TYPE Type;
/**
* @brief Delivery_Distance in Km
*
*/
float Delivery_Distance;
double Cost;
int ID;
int Truck_ID;
public:
/**
* @brief Construct a new Cargo object
*
* @param T
* @param PT
* @param id
* @param DD
* @param LT
* @param C
*/
Cargo(CARGO_TYPE T, const Time& PT, int id, float DD, float LT, double C);
/**
* @brief Construct a new Cargo object Fake cargo just for comparison with id
* @param id
*/
Cargo(int id);
/**
* @brief Get the Distance of cargo
*
* @return float
*/
float GetDistance() const;
/**
* @brief Get the Cost of cargo
*
* @return double
*/
double GetCost() const;
/**
* @brief Get the loud time of cargo
*
* @return float
*/
float GetLU_Time() const;
/**
* @brief Get the Type of cargo
*
* @return CARGO_TYPE
*/
CARGO_TYPE GetType() const;
/**
* @brief Get the Prep Time of cargo
*
* @return Time&
*/
Time& GetPrepTime();
/**
* @brief Add Extra Money to Normal cargo when Promote To Vip
*
* @param ExtraMoney
*/
void PromoteToVip(double ExtraMoney);
/**
* @brief overloading == operator
*
* @param ptr
* @return true || false
*/
bool operator==(Cargo* ptr);
/**
* @brief Get cargo id
*
* @return int
*/
int GetID() const;
/**
* @brief Set The truck carrying the cargo ID
*
* @param id
*/
void Set_Truck_ID(int id);
/**
* @brief Get The truck carrying the cargo ID
* @return int
*/
int Get_Truck_ID();
/**
* @brief Set The Delivery time
*
* @param Time
*/
void Set_DT(Time t);
/**
* @brief Set The Wait time
*
* @param int t
*/
void Set_WT(int t);
/**
* @brief Get The Delivery time
*
* @return Time&
*/
Time& Get_DT();
/**
* @brief Get The Wait time
*
* @return Time&
*/
Time& Get_WT();
/**
* @brief Get Preparation Time
*
* @return Time&
*/
Time& Get_Preparation_Time();
};
/**
* @brief overloading << operator
*
* @param ostream& out
* @param Cargo* c
* @return ostream&
*/
ostream& operator<<(ostream& out, const Cargo* c);