~narrow-m/mcplanner/trunk

« back to all changes in this revision

Viewing changes to world.h

  • Committer: Moritz Schmale
  • Date: 2011-01-09 23:40:11 UTC
  • Revision ID: narrow.m@gmail.com-20110109234011-b2cv8dbhildd41z2
First commit.
Features:
-Drawing Blocks on multiple Layers
-Saving, Loading
-Choosing Block to draw from an iconed list
-Generating a plain Block of specifieable height width and depth as well as top and fill BlockType.
-PainterlyPack is used for the artwork. In later Versions, you can specify an own terrain.png to use your favorite artwork.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef WORLD_H
 
2
#define WORLD_H
 
3
 
 
4
#include <QGraphicsScene>
 
5
#include "layer.h"
 
6
 
 
7
class World : public QGraphicsScene
 
8
{
 
9
    Q_OBJECT
 
10
public:
 
11
    explicit World(QObject *parent = 0);
 
12
        inline int layers(){return myLayers.count();}
 
13
        void save(QIODevice *device);
 
14
        void load(QIODevice *device);
 
15
        void getMinMaxLayer(int &min, int &max);
 
16
        void setActiveLayer(int layer);
 
17
        Block *addBlock(QPoint pos, int y, BlockType type);
 
18
        void addPointToBoundaries(QPoint pos);
 
19
        QRect boundaries();
 
20
signals:
 
21
        void layerCountChanged(int);
 
22
        void activeLayerChanged(int);
 
23
public slots:
 
24
        Layer *addLayer(bool onTop);
 
25
        void clear();
 
26
private:
 
27
        QMap<int, Layer*> myLayers;
 
28
        QRect myBoundaries;
 
29
};
 
30
 
 
31
#endif // WORLD_H