-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.h
More file actions
67 lines (56 loc) · 1.61 KB
/
Copy pathconfig.h
File metadata and controls
67 lines (56 loc) · 1.61 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
64
65
66
67
#pragma once
#include "swarminfo.h"
#include <QFile>
#include <QHash>
#include <QList>
#include <QPair>
#include <QTextStream>
#define NAME_LENGTH 5
namespace game {
class Config {
private:
// methods
static Config* s_configInstance;
void processShip(QTextStream& in);
void processConfigSizeLine(QString l);
void processInstructions(QStringList& instructs, QStringList& copy);
void processSwarm(QTextStream& in);
void processPairs(QStringList list, QList<QPair<int, int>>& positions);
void processMoves(QStringList& move, QStringList& list);
void saveSwarm(unsigned totalStageNum, QString type, QList<QPair<int, int>> positions, QStringList move, int shoot);
void scalePositions();
// SHIP values
QString name; // this will be useful in Stage 3 ;)
double scale;
int startpos;
int frames;
QStringList instructs;
QString defaultInstructs;
int SCALEDWIDTH;
int SCALEDHEIGHT;
// Swarm Info Map
std::vector<QList<SwarmInfo>> swarmListStages;
// default Alien values
QStringList alienTypes;
QString defaultAlienType;
QStringList defaultAlienMove;
const int defaultAlienShoot = 10;
int totalStageNum;
void initDefault();
protected:
Config();
public:
// AS THE CONFIG GIVES INPUT, THE FILE IS READ TO THEN SET ATTRIBUTES.
// GETTERS
static Config* getInstance();
~Config();
QString get_name();
double get_scale();
int get_startpos();
QStringList get_instructs();
std::vector<QList<SwarmInfo>> getSwarmList();
int get_frames();
int get_SCALEDWIDTH();
int get_SCALEDHEIGHT();
};
}