Source Code (Use browser search to find items of interest.)
Class Index
kmahjongg'GAMEDATA (./kdegames/kmahjongg/kmahjongg.h:64)
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<BoardLayout::depth; e++) {
if (Board[e][y][x] && Mask[e][y][x]) {
h++;
} else {
return h;
}
}
return h;
}
kmahjongg'GAMEDATA::shadowHeight() (./kdegames/kmahjongg/kmahjongg.h:94)
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<BoardLayout::depth; e++) {
if (Board[e][y][x] && Mask[e][y][x]) {
h++;
} else {
return h;
}
}
return h;
}