This repository has been archived by the owner on Jan 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.h
95 lines (80 loc) · 2.81 KB
/
globals.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
#ifndef GLOBALS_H
#define GLOBALS_H
using namespace std;
#include <vector>
#include <string>
#include <QTimer>
#include <fstream>
#include <iostream>
#include <sstream>
#include <queue>
#include "gform.h"
class globals{
public:
globals();
~globals();
//INSTANCES
static globals* instance();
//VARIABLES
QTimer* gTimer;
QString gName = "CPPong";
QString gClaim = "A cutting edge application";
int gColorSwitcherId;
QTimer* gSystemTimer;
//FUNCTIONS
void increase_gDisplayFactor();
void decrease_gDisplayFactor();
void start_gTimer(int val);
void stop_gTimer();
void start_gSystemTimer(int val);
void stop_gSystemTimer();
void addForm_gForms(GForm form);
void populate_gForms();
void switchColor();
void gSaveCppong();
void gLoadCppong();
int random(int min, int max);
//SETTER-FUNCTIONS
void set_gDebug(bool val);
void set_gRunning(bool val);
void set_gSystemTimer(QTimer *timer);
void set_gTimer(QTimer *timer);
void set_gForms(vector<GForm> forms);
void set_gApproximation(int val);
void set_gDisplayFactor(float val);
//GETTER-FUNCTIONS
bool get_gDebug();
bool get_gRunning();
vector<GForm> get_gForms();
QTimer* get_gSystemTimer();
QTimer* get_gTimer();
float get_gDisplayFactor();
bool get_gColorSwitch();
int get_gApproximation();
//MESSAGE-FUNCTIONS
void push_gMessage(string strg); //direct use is deprecated, use log() instead!
void log(string strg, bool debug = true);
queue<string> get_gMessages();
string pop_gMessage();
private:
//VARIABLES
bool gDebug;
bool gRunning;
float gDisplayFactor;
int gFormCount;
int gApproximation;
int gRandom;
int gRandomMin;
int gRandomMax;
bool gColorSwitch;
bool gShowCollisonBoxes;
string gSaved;
vector<GForm> gForms;
vector<int> gField;
queue<string> gMessages;
//FUNCTIONS
int assignId();
string getCurrentPath();
string getFilePath();
};
#endif // GLOBALS_H