-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransfer.h
More file actions
63 lines (44 loc) · 1.42 KB
/
transfer.h
File metadata and controls
63 lines (44 loc) · 1.42 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
55
56
57
58
59
60
61
62
63
#ifndef TRANSFER_H
#define TRANSFER_H
#include <string>
#include "sector.h"
#include "expression.h"
class Transfer
{
public:
Transfer(Sector *dest, Sector *src, string var, string descr, bool negate = false);
virtual ~Transfer();
string getSourceName();
string getDestName();
string getSourceShortName();
string getDestShortName();
string getSourceNameAlt();
string getDestNameAlt();
string getVarName();
string getDescription();
Sector *getSource();
Sector *getDest();
static vector<Transfer*> &getTransfers();
static Transfer *find(string);
static void clear();
static bool execAll(int serial);
static void initAll(); // clear all balances
void init(); // clear balance
static Transfer *create(string &dest, string &src, string &name, string &descr);
bool exec(int serial);
enum Error {
no_error = 0,
no_such_expr = 1,
cannot_evaluate = 2
};
Error error;
protected:
private:
string m_var, m_descr;
Expression *expr; // nullptr if not yet defined - retrieve using m_var
Sector *m_dest;
Sector *m_src;
bool m_negate;
static vector<Transfer*> transfers;
};
#endif // TRANSFER_H