add loader

add schema
new loader model using xml
separated work and load data
validation using schema
map data in xml
new core model... proecting
This commit is contained in:
2010-08-19 20:52:32 +03:00
parent 87455a622e
commit da42fe8f58
20 changed files with 943 additions and 140 deletions

15
map.h
View File

@@ -3,7 +3,7 @@
#include <QObject>
#include <QSize>
#include <QVector>
#include <QList>
#include <QPointF>
#include <QRect>
#include <QFile>
@@ -11,6 +11,8 @@
#include "base_types.h"
#include "settreader.h"
// Maximum map is 65530 x 65530 because qHash may be repeat and towers has same Id
class Map : public QObject
{
Q_OBJECT
@@ -37,10 +39,8 @@ public:
// -1000 - it is wall or some place where you can't build
QVector < QVector <int> > Cells;
QVector < QVector <int> > TmpCells;
QVector <QPoint> starts;
QVector <QPoint> finishs;
QSize mapsize;
QList <QPoint> starts;
QList <QPoint> finishs;
int maxPlayers;
explicit Map(int Id, QObject *parent = 0);
@@ -50,7 +50,7 @@ public:
void removeAliensPath();
QVector <QPointF> CreatePath(QPoint start, QPoint finish);
QSize size() const {return mapsize;}
void ReadSettings();
void load();
signals:
void RecreateAlienPath(bool * pathOK);
public slots:
@@ -58,10 +58,13 @@ public slots:
private:
int mapId;
QSize mapsize;
QVector < QVector <int> > TmpCells;
QVector<QPoint> InvWaveTrace(QPoint finish, int cnt);
int WaveTrace(QPoint start, QPoint finish);
void CreateMapExample();
void ReadSettings();
};
#endif // MAP_H