-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
33 lines (31 loc) · 936 Bytes
/
main.cpp
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
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "skill.hpp"
#include <QDebug>
#include <QVariant>
#include "gamedata.h"
#include "datacreate.h"
#include "battle.h"
int main(int argc, char *argv[]){
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
QQmlContext *ctx = engine.rootContext();
DataCreate dataMake;
GameData data;
Battle battle;
//Loading game data
data.loadMonster();
data.loadSkill();
data.loadTrainer();
battle.setPlayer(data.player());
battle.nextEnemy(100);
battle.nextFront();
ctx->setContextProperty("_battle",&battle);
ctx->setContextProperty("_make",&dataMake);
ctx->setContextProperty("_data",&data);
QGuiApplication::setApplicationName("Battle Monster");
QGuiApplication::setApplicationVersion("1.0");
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}