#ifndef LAYER_H
#define LAYER_H


#include "Cell.h"
#include "view.h"
#include "data.h"


//stat of Layer
///######9 I PUT THIS IN TO CHAINGE BACK THE GRID. SO THE EDIT TILE SETS CAN BE DISPLADE
//THE OTHER DEFINE IS IN THE MAIN




class Layer
{
	private:
		
		int id;
		string filename;
		
		BITMAP *Layergrid;	// buffer for our grid
		bool masked;
		

	public:
	Cell cells[WORLD_Y_MAX][WORLD_X_MAX];
		//// Layer construters
		Layer();
		~Layer()
		{
	destroy_bitmap(Layergrid);
			num_of_layers--;
			
		}
		int WORLD_X; 
		int WORLD_Y;			
		int num_of_layers;
		int layer_num;
		void set_filename(string);
		string get_filename();
		void load_layer();
		void save_layer();
		void set_masked(bool);
void drawRectangle(BITMAP *bmp,int x, int y, int w,int h,int color, int style, int bgcolor);
void load_layer2();
		BITMAP * get_layerBitmap();
		bool get_masked();
		void update_layer(View,TileAnimeList,int,DATAFILE *);
		void draw_layer(View);
		void draw_layer2(View,BITMAP*);
		void edit(View,TileAnimeList ,DATAFILE *);
		
	};
	//end of Layer

#endif