#ifndef BOARDWIDGET_H #define BOARDWIDGET_H #include #include #include #include "KmTypes.h" #include "Tileset.h" #include "Background.h" #include "BoardLayout.h" typedef struct gamedata { int allow_undo; int allow_redo; UCHAR Board[BoardLayout::depth][BoardLayout::height][BoardLayout::width]; USHORT TileNum; USHORT MaxTileNum; UCHAR Mask[BoardLayout::depth][BoardLayout::height][BoardLayout::width]; UCHAR hilighted[BoardLayout::depth][BoardLayout::height][BoardLayout::width]; POSITION MoveList[BoardLayout::maxTiles]; void putTile( short e, short y, short x, UCHAR f ) { Board[e][y][x] = Board[e][y+1][x] = Board[e][y+1][x+1] = Board[e][y][x+1] = f; } void putTile( POSITION& pos ) { putTile( pos.e, pos.y, pos.x, pos.f ); } bool tilePresent(int z, int y, int x) { return(Board[z][y][x]!=0 && Mask[z][y][x] == '1'); } bool partTile(int z, int y, int x) { return (Board[z][y][x] != 0); } int shadowHeight(int z, int y, int x) { if ((z>=BoardLayout::depth||y>=BoardLayout::height||x>=BoardLayout::width)) return 0; if ((y < 0) || (x < 0)) return 0; int h=0; for (int e=z; e