-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmdUI.h
156 lines (131 loc) · 3.63 KB
/
cmdUI.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
151
152
153
154
155
156
/**
* @file C:\Users\ineeve\Documents\GitHub\aeda-casino\cmdUI.h
*
* @brief Declares the command user interface.
*/
#pragma once
#ifdef _WIN32
#define OS_Windows 0 /* @brief It Means that the application is running on a Windows System*/
#include <windows.h>
#else
#define OS_Windows 1
#endif
#include <iostream>
#include "utils.h"
#include <iomanip>
using namespace std;
/**
* @fn void clearScreen();
*
* @brief Clears the terminal.
*
* @author Ineeve
* @date 19/11/2016
*/
void clearScreen();
/**
* @fn void cursorxy(short x, short y);
*
* @brief Set cursor on <x,y> coordinates.
*
* @author Ineeve
* @date 19/11/2016
*
* @param x The x coordinate.
* @param y The y coordinate.
*/
void cursorxy(short x, short y);
/**
* @fn pair <int, int> centerWindow();
*
* @brief Center the terminal window.
* The returned length is measured in characters.
* @author Ineeve
* @date 19/11/2016
*
* @return A pair <x,y>. x= terminal horizontal length, y = terminal vertical length.
*/
pair <int, int> centerWindow();
/**
* @fn void drawTitle(pair <short, short> xy);
*
* @brief Displays the title.
*
* @author João Carvalho
* @date 26/12/2016
*
* @param xy A pair containing the horizontal and vertical lengths of the terminal.
*/
void drawTitle(pair <short, short> xy);
/**
* @fn void start_menu(pair <short, short> xy, int &choice);
*
* @brief Displays the main menu.
*
* @author Ineeve
* @date 19/11/2016
*
* @param xy A pair containing the horizontal and vertical lengths of the terminal.
* @param [in,out] choice The user choice.
*/
void start_menu(pair <short, short> xy, int &choice);
/**
* @fn void manageCasino(pair <short, short> xy, unsigned int &choice);
*
* @brief Displays the manage casino menu and reads user choice.
*
* @author Ineeve
* @date 19/11/2016
*
* @param xy A pair containing the horizontal and vertical lengths of the terminal.
* @param [in,out] choice The user choice.
*/
void manageCasino(pair <short, short> xy, unsigned int &choice);
/**
* @fn void createMenu(pair <short, short> xy, unsigned int &choice);
*
* @brief Creates a menu.
*
* @author Ineeve
* @date 19/11/2016
*
* @param xy A pair containing the horizontal and vertical lengths of the terminal.
* @param [in,out] choice The user choice.
*/
void createMenu(pair <short, short> xy, unsigned int &choice);
/**
* @fn void deleteMenu(pair <short, short> xy, unsigned int &choice);
*
* @brief Displays a delete menu and reads user choice.
*
* @author Ineeve
* @date 19/11/2016
*
* @param xy A pair containing the horizontal and vertical lengths of the terminal.
* @param [in,out] choice The user choice.
*/
void deleteMenu(pair <short, short> xy, unsigned int &choice);
/**
* @fn void manageTableMenu(pair <short, short> xy, unsigned int &choice);
*
* @brief Displays the manage table menu and reads user choice.
*
* @author Ineeve
* @date 19/11/2016
*
* @param xy A pair containing the horizontal and vertical lengths of the terminal.
* @param [in,out] choice The user choice.
*/
void manageTableMenu(pair <short, short> xy, unsigned int &choice);
/**
* @fn void statisticsMenu(pair <short, short> xy, unsigned int &choice);
*
* @brief Displays the statistics menu and reads user choice.
*
* @author Ineeve
* @date 30/12/2016
*
* @param xy A pair containing the horizontal and vertical lengths of the terminal.
* @param [in,out] choice The user choice.
*/
void statisticsMenu(pair<short, short> xy, unsigned int &choice);