-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatm.h
53 lines (41 loc) · 1.2 KB
/
atm.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
#ifndef ATM_H
#define ATM_H
#include <QObject>
#include <QMap>
#include "controllers/uicontroller.h"
#include "bank.h"
#include "localmediator.h"
class SessionController;
class ATM : public QObject
{
Q_OBJECT
public:
ATM(ATMMainWindow* ui, int id, const QString& location, QMap<int, int> money, QList<QString> knownCards);
bool cardExists(const QString& card);
bool isCardBlocked(const QString& card);
bool isCardExpired(const QString& card);
int getBalance(const QString& card);
bool checkPIN(const QString& card, const QString& pin);
QString changePIN(const QString& card);
bool canWithdrawSum(size_t sum);
void withdrawBanknotes(size_t sum);
void addBanknotes(QMap<int,int> banknotes);
void addBalance(size_t sum, const QString& card);
void subtractBalance(size_t sum, const QString& card);
const QString createCard(const QString& card);
void blockCard(const QString& card);
void unblockCard(const QString& card);
const QString getLocation();
int getId();
private:
Bank* _bank;
LocalMediator* _mediator;
UIController* _uc;
int _id;
QString _location;
QMap<int, int> _money;
QList<QString> _knownCards;
SessionController* _sc;
QMap<int,int> sumToBanknotes(size_t sum);
};
#endif // ATM_H